]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: fixup xfs_attr_get_ilocked
authorChristoph Hellwig <hch@lst.de>
Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)
committerEric Sandeen <sandeen@redhat.com>
Mon, 31 Jul 2017 20:08:12 +0000 (15:08 -0500)
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>
libxfs/xfs_attr.c

index f8250da0239a7d1dc7b9e32f567c1d538cef6edf..a595fbf6c7d67eef8c2e3ae046ca12e2172cfc2e 100644 (file)
@@ -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)