xfs: combine two if statements with same condition
authorKaixu Xia <kaixuxia@tencent.com>
Thu, 23 Apr 2020 04:54:28 +0000 (21:54 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 4 May 2020 16:03:14 +0000 (09:03 -0700)
The two if statements have same condition, and the mask value
does not change in xfs_setattr_nonsize(), so combine them.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_iops.c

index f7a99b3bbcf7a37e4ce4fba965b2c53a424c9b0a..e3481459045345e798579305457974ebbf3591ca 100644 (file)
@@ -738,12 +738,7 @@ xfs_setattr_nonsize(
                        if (error)      /* out of quota */
                                goto out_cancel;
                }
-       }
 
-       /*
-        * Change file ownership.  Must be the owner or privileged.
-        */
-       if (mask & (ATTR_UID|ATTR_GID)) {
                /*
                 * CAP_FSETID overrides the following restrictions:
                 *