[PATCH RFC 6/8] xfs: fix imbalanced locking

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

 



The XFS_ILOCK_SHARED type lock is held in the xfs_ioc_fsgetxattr
but does not released when the inode is in local format, fix it by
eleasing the lock on the local format inode.

Signed-off-by: Shan Hai <shan.hai@xxxxxxxxxx>
---
 fs/xfs/xfs_ioctl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 0ef5ece5634c..246562615ccd 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -907,7 +907,10 @@ xfs_ioc_fsgetxattr(
 	} else {
 		if (ip->i_df.if_flags & XFS_IFEXTENTS)
 			fa.fsx_nextents = xfs_iext_count(&ip->i_df);
-		else
+		else if (ip->i_df.if_flags & XFS_IFINLINE) {
+			xfs_iunlock(ip, XFS_ILOCK_SHARED);
+			return 0;
+		} else
 			fa.fsx_nextents = ip->i_d.di_nextents;
 	}
 	xfs_iunlock(ip, XFS_ILOCK_SHARED);
-- 
2.11.0

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



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux