Since BTRFS_IOC_FS_INFO does not require root privilege, there is no
need to check EPERM error.
Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>
Signed-off-by: Tomohiro Misono <misono.tomohiro@xxxxxxxxxxxxxx>
---
cmds-fi-usage.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
index 2d45b3bb..5ce87a37 100644
--- a/cmds-fi-usage.c
+++ b/cmds-fi-usage.c
@@ -549,8 +549,6 @@ static int load_device_info(int fd, struct device_info **device_info_ptr,
ret = ioctl(fd, BTRFS_IOC_FS_INFO, &fi_args);
if (ret < 0) {
- if (errno == EPERM)
- return -errno;
error("cannot get filesystem info: %m");
return 1;
}
@@ -635,11 +633,6 @@ int load_chunk_and_device_info(int fd, struct chunk_info **chunkinfo,
}
ret = load_device_info(fd, devinfo, devcount);
- if (ret == -EPERM) {
- warning(
- "cannot get filesystem info from ioctl(FS_INFO), run as root");
- ret = 0;
- }
return ret;
}
--
2.14.3
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html