[ get_avail_device() sometimes returns an ERR_PTR ]

Hi Liu,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git 
master
head:   3d294381647ab114f525a0ccf3d28f8172ce6a5f
commit: 3d294381647ab114f525a0ccf3d28f8172ce6a5f [21/21] Btrfs: resize all 
devices when we dont assign a specific, device id

  fs/btrfs/ioctl.c:386 create_subvol() warn: function puts 544 bytes on stack
+ fs/btrfs/ioctl.c:1436 btrfs_ioctl_resize() error: 'device' dereferencing 
possible ERR_PTR()

git remote add josef-btrfs 
git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git
git remote update josef-btrfs
git checkout 3d294381647ab114f525a0ccf3d28f8172ce6a5f
vim +/device +1436 fs/btrfs/ioctl.c

3d294381 Liu Bo            2012-12-20  1420                     ret = -EINVAL;
3d294381 Liu Bo            2012-12-20  1421                     goto out_free;
3d294381 Liu Bo            2012-12-20  1422             }
3d294381 Liu Bo            2012-12-20  1423     }
3d294381 Liu Bo            2012-12-20  1424  
3d294381 Liu Bo            2012-12-20  1425     if (devid < -1ULL)
3d294381 Liu Bo            2012-12-20  1426             device = 
btrfs_find_device(root->fs_info, devid, NULL, NULL);
3d294381 Liu Bo            2012-12-20  1427     else
3d294381 Liu Bo            2012-12-20  1428             device = 
get_avail_device(root, 0);
3d294381 Liu Bo            2012-12-20  1429  again:
f46b5a66 Christoph Hellwig 2008-06-11  1430     if (!device) {
5bb14682 Arnd Hannemann    2011-11-20  1431             printk(KERN_INFO 
"btrfs: resizer unable to find device %llu\n",
21380931 Joel Becker       2009-04-21  1432                    (unsigned long 
long)devid);
f46b5a66 Christoph Hellwig 2008-06-11  1433             ret = -EINVAL;
c9e9f97b Ilya Dryomov      2012-01-16  1434             goto out_free;
f46b5a66 Christoph Hellwig 2008-06-11  1435     }
4e42ae1b Liu Bo            2012-06-14 @1436     if (device->fs_devices && 
device->fs_devices->seeding) {
4e42ae1b Liu Bo            2012-06-14  1437             printk(KERN_INFO 
"btrfs: resizer unable to apply on "
a8c4a33b Chris Mason       2012-06-15  1438                    "seeding device 
%llu\n",
a8c4a33b Chris Mason       2012-06-15  1439                    (unsigned long 
long)devid);
4e42ae1b Liu Bo            2012-06-14  1440             ret = -EINVAL;
4e42ae1b Liu Bo            2012-06-14  1441             goto out_free;
4e42ae1b Liu Bo            2012-06-14  1442     }
4e42ae1b Liu Bo            2012-06-14  1443  
3d294381 Liu Bo            2012-12-20  1444     if (use_max)

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to