diff mbox

[2/4] xfs: assert locking precondіtion in xfs_attr_list_int_ilocked

Message ID 20170713113304.8079-3-hch@lst.de (mailing list archive)
State Accepted
Headers show

Commit Message

Christoph Hellwig July 13, 2017, 11:33 a.m. UTC
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_attr_list.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Darrick J. Wong July 13, 2017, 7:23 p.m. UTC | #1
On Thu, Jul 13, 2017 at 01:33:02PM +0200, Christoph Hellwig wrote:

Not sure about the garbled utf8 crud in the subject line, but otherwise
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/xfs/xfs_attr_list.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
> index 545eca508d42..7740c8a5e736 100644
> --- a/fs/xfs/xfs_attr_list.c
> +++ b/fs/xfs/xfs_attr_list.c
> @@ -463,6 +463,8 @@ xfs_attr_list_int_ilocked(
>  {
>  	struct xfs_inode		*dp = context->dp;
>  
> +	ASSERT(xfs_isilocked(dp, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL));
> +
>  	/*
>  	 * Decide on what work routines to call based on the inode size.
>  	 */
> -- 
> 2.11.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index 545eca508d42..7740c8a5e736 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -463,6 +463,8 @@  xfs_attr_list_int_ilocked(
 {
 	struct xfs_inode		*dp = context->dp;
 
+	ASSERT(xfs_isilocked(dp, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL));
+
 	/*
 	 * Decide on what work routines to call based on the inode size.
 	 */