From baebed8247cc908dcc3378e5c21d5b1f4aabe28f Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 31 Jul 2017 15:08:12 -0500 Subject: [PATCH] xfs: fixup xfs_attr_get_ilocked Source kernel commit: cf69f8248cc89c0a0e82f8332f9e7f13ab014c98 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 Signed-off-by: Eric Sandeen --- libxfs/xfs_attr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index f8250da02..a595fbf6c 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -109,12 +109,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.47.2