Linux-XFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] xfs_io: Remove redundant setting/check for lsattr/stat command
@ 2020-07-24  7:14 Xiao Yang
  2020-07-30  0:46 ` Eric Sandeen
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Yang @ 2020-07-24  7:14 UTC (permalink / raw)
  To: linux-xfs; +Cc: sandeen, darrick.wong, Xiao Yang

lsattr/stat command can check exclusive options by argmax = 1
so the related setting/check is redundant.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 io/attr.c | 2 --
 io/stat.c | 5 -----
 2 files changed, 7 deletions(-)

diff --git a/io/attr.c b/io/attr.c
index 181ff089..fd82a2e7 100644
--- a/io/attr.c
+++ b/io/attr.c
@@ -198,10 +198,8 @@ lsattr_f(
 			break;
 		case 'a':
 			aflag = 1;
-			vflag = 0;
 			break;
 		case 'v':
-			aflag = 0;
 			vflag = 1;
 			break;
 		default:
diff --git a/io/stat.c b/io/stat.c
index 5f513e0d..49c4c27c 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -142,11 +142,6 @@ stat_f(
 		}
 	}
 
-	if (raw && verbose) {
-		exitcode = 1;
-		return command_usage(&stat_cmd);
-	}
-
 	if (fstat(file->fd, &st) < 0) {
 		perror("fstat");
 		exitcode = 1;
-- 
2.21.0




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs_io: Remove redundant setting/check for lsattr/stat command
  2020-07-24  7:14 [PATCH] xfs_io: Remove redundant setting/check for lsattr/stat command Xiao Yang
@ 2020-07-30  0:46 ` Eric Sandeen
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Sandeen @ 2020-07-30  0:46 UTC (permalink / raw)
  To: Xiao Yang, linux-xfs; +Cc: darrick.wong

On 7/24/20 12:14 AM, Xiao Yang wrote:
> lsattr/stat command can check exclusive options by argmax = 1
> so the related setting/check is redundant.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Looks good.  I guess we are not very consistent about our use
of argmax :)

Reviewed-by: Eric Sandeen <sandeen@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24  7:14 [PATCH] xfs_io: Remove redundant setting/check for lsattr/stat command Xiao Yang
2020-07-30  0:46 ` Eric Sandeen

Linux-XFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-xfs/0 linux-xfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-xfs linux-xfs/ https://lore.kernel.org/linux-xfs \
		linux-xfs@vger.kernel.org
	public-inbox-index linux-xfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-xfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git