From: Christoph Hellwig Date: Mon, 31 Jul 2017 20:08:12 +0000 (-0500) Subject: xfs: fixup xfs_attr_get_ilocked X-Git-Tag: v4.13.0-rc1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baebed8247cc908dcc3378e5c21d5b1f4aabe28f;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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)