[PATCH] xfs: re-organize XFS_ILOCK asserts in xfs_itruncate_extents() [V2]

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

 



An logically OR'red assert for check an inode locked in XFS_ILOCK_EXCL and
XFS_IOLOCK_EXCL looks better than the old way, avoiding possible mistakes while
readin the code

V2: Fix a doubled assert in i_count left in V1

Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
---
 fs/xfs/xfs_inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 66282dc..b05c361 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1395,9 +1395,9 @@ xfs_itruncate_extents(
 	int			error = 0;
 	int			done = 0;
 
-	ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
-	ASSERT(!atomic_read(&VFS_I(ip)->i_count) ||
+	ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL) ||
 	       xfs_isilocked(ip, XFS_IOLOCK_EXCL));
+	ASSERT(!atomic_read(&VFS_I(ip)->i_count));
 	ASSERT(new_size <= XFS_ISIZE(ip));
 	ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
 	ASSERT(ip->i_itemp != NULL);
-- 
1.8.1

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux