]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Fix cmd_fs_usage for more than 4 devices
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 13 Jun 2019 15:10:11 +0000 (11:10 -0400)
committerKent Overstreet <kent.overstreet@gmail.com>
Thu, 13 Jun 2019 15:10:49 +0000 (11:10 -0400)
The ioctl returns -ERANGE when there's more devices than fit in the
buffer, not -ENOSPC

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
libbcachefs.h

index d6b8548d65f4b33c29698ab6b9182883e26ace1c..61d0ea8d05a89e78dd3d035b24647d661e9907e2 100644 (file)
@@ -152,7 +152,7 @@ static inline struct bch_ioctl_usage *bchu_usage(struct bchfs_handle fs)
                if (!ioctl(fs.ioctl_fd, BCH_IOCTL_USAGE, u))
                        return u;
 
-               if (errno != ENOSPC)
+               if (errno != ERANGE)
                        die("BCH_IOCTL_USAGE error: %m");
                nr_devices *= 2;
        }