All of lore.kernel.org
 help / color / mirror / 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 related	[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, other threads:[~2020-07-30  0:46 UTC | newest]

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

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.