Thread (10 messages) 10 messages, 2 authors, 2017-11-30
STALE3159d

[PATCH 3/3] btrfs-progs: fi usage: cleanup unneccessary permission error check

From: Misono, Tomohiro <hidden>
Date: 2017-11-30 07:53:19
Subsystem: the rest · Maintainer: Linus Torvalds

Since BTRFS_IOC_FS_INFO does not require root privilege, there is no
need to check EPERM error.

Signed-off-by: Tomohiro Misono <redacted>
---
 cmds-fi-usage.c | 7 -------
 1 file changed, 7 deletions(-)
diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
index 7bbc9896..b0721560 100644
--- a/cmds-fi-usage.c
+++ b/cmds-fi-usage.c
@@ -522,8 +522,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: %s",
 				strerror(errno));
 		return 1;
@@ -597,11 +595,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.13.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help