diff options
author | Christoph Hellwig <hch@lst.de> | 2017-07-31 15:08:12 -0500 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2017-07-31 15:08:12 -0500 |
commit | baebed8247cc908dcc3378e5c21d5b1f4aabe28f (patch) | |
tree | 478174dfa546a60bf00c7591ae166c1d01ad8d1e | |
parent | a6c6b1bd72f63b2bb05cae185abef0da24e0bf28 (diff) | |
download | xfsprogs-dev-baebed8247cc908dcc3378e5c21d5b1f4aabe28f.tar.gz |
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 <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r-- | libxfs/xfs_attr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index f8250da023..a595fbf6c7 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) |