diff options
author | Christoph Hellwig <hch@lst.de> | 2017-07-13 15:14:33 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-07-13 17:55:05 -0400 |
commit | cf69f8248cc89c0a0e82f8332f9e7f13ab014c98 (patch) | |
tree | c1f37d931f61a551d0f1ceec9518cf170c6be14a | |
parent | cd87d867920155911d0d2e6485b769d853547750 (diff) |
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 <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/libxfs/xfs_attr.c | 4 |
1 files changed, 3 insertions, 1 deletions
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( | |||
114 | * Overall external interface routines. | 114 | * Overall external interface routines. |
115 | *========================================================================*/ | 115 | *========================================================================*/ |
116 | 116 | ||
117 | /* Retrieve an extended attribute and its value. Must have iolock. */ | 117 | /* Retrieve an extended attribute and its value. Must have ilock. */ |
118 | int | 118 | int |
119 | xfs_attr_get_ilocked( | 119 | xfs_attr_get_ilocked( |
120 | struct xfs_inode *ip, | 120 | struct xfs_inode *ip, |
121 | struct xfs_da_args *args) | 121 | struct xfs_da_args *args) |
122 | { | 122 | { |
123 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL)); | ||
124 | |||
123 | if (!xfs_inode_hasattr(ip)) | 125 | if (!xfs_inode_hasattr(ip)) |
124 | return -ENOATTR; | 126 | return -ENOATTR; |
125 | else if (ip->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) | 127 | else if (ip->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) |