[PATCH][next] xfs: fix zero'ing of ILOG owner bits by using correct bitwise operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Currently the masking of the ili_fields is using the ! operator which
results in masking with 0, which clears all the bits which is not
intended.  Instead, use the ~ operator that negates the inverts the
bits to correctly mask out the XFS_ILOG_AOWNER and XFS_ILOG_DOWNER
bits.

Detected by CoverityScan, CID#1466877 ("Logical vs bitwise operator")

Fixes: 3fdf96830762 ("xfs: do not log swapext extent owner changes for deleted")
Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
---
 fs/xfs/xfs_inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index a16f48fde4da..3e3aab3888fa 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2477,7 +2477,7 @@ xfs_ifree(
 	ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
 
 	/* Don't attempt to replay owner changes for a deleted inode */
-	ip->i_itemp->ili_fields &= !(XFS_ILOG_AOWNER|XFS_ILOG_DOWNER);
+	ip->i_itemp->ili_fields &= ~(XFS_ILOG_AOWNER|XFS_ILOG_DOWNER);
 
 	/*
 	 * Bump the generation count so no one will be confused
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux