From cf69f8248cc89c0a0e82f8332f9e7f13ab014c98 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Jul 2017 12:14:33 -0700 Subject: [PATCH] xfs: fixup xfs_attr_get_ilocked The comment mentioned the wrong lock. Also add an ASSERT to assert this locking precondition. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_attr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index ef8a1c75a467..de7b9bd30bec 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -114,12 +114,14 @@ xfs_inode_hasattr( * Overall external interface routines. *========================================================================*/ -/* Retrieve an extended attribute and its value. Must have iolock. */ +/* Retrieve an extended attribute and its value. Must have ilock. */ int xfs_attr_get_ilocked( struct xfs_inode *ip, struct xfs_da_args *args) { + ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL)); + if (!xfs_inode_hasattr(ip)) return -ENOATTR; else if (ip->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) -- 2.20.1