All of lore.kernel.org
 help / color / mirror / Atom feed
From: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: [PATCH v2 3/3] btrfs-progs: fi usage: cleanup unnecessary permission error check
Date: Thu, 29 Mar 2018 17:23:39 +0900	[thread overview]
Message-ID: <a7a4f704-f2bc-1231-dec2-de5524f3bbdd@jp.fujitsu.com> (raw)
In-Reply-To: <99d3f3bf-ecc3-b6f5-c38c-8fba83db48d0@jp.fujitsu.com>

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

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
 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


  parent reply	other threads:[~2018-03-29  8:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29  8:21 [PATCH v2 0/3] btrfs-progs: Some fix for fi usage Misono Tomohiro
2018-03-29  8:22 ` [PATCH v2 1/3] btrfs-progs: fi usage: change warning message more appropriately Misono Tomohiro
2018-03-29  8:34   ` Nikolay Borisov
2018-03-29  8:23 ` [PATCH v2 2/3] btrfs-progs: fi usage: change to output more info without root privilege Misono Tomohiro
2018-03-29  8:23 ` Misono Tomohiro [this message]
2018-03-30 17:21   ` [PATCH v2 3/3] btrfs-progs: fi usage: cleanup unnecessary permission error check David Sterba
2018-05-09 11:42 ` [PATCH v2 0/3] btrfs-progs: Some fix for fi usage David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7a4f704-f2bc-1231-dec2-de5524f3bbdd@jp.fujitsu.com \
    --to=misono.tomohiro@jp.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.