xfs
[Top] [All Lists]

Re: [PATCH] xfs: lock the rt summary inode when unmapping realtime exten

To: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Subject: Re: [PATCH] xfs: lock the rt summary inode when unmapping realtime extents
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 30 Jun 2016 08:21:42 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160629200234.GE4917@xxxxxxxxxxxxxxxx>
References: <20160629200234.GE4917@xxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Jun 29, 2016 at 01:02:34PM -0700, Darrick J. Wong wrote:
> When we're deleting realtime extents, lock the summary inode
> in case we need to update the summary info.  This prevents an
> assert on the rsumip inode lock on a debug kernel.
> 
> (Same idea as "xfs: lock rt summary inode on allocation".)
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
>  fs/xfs/libxfs/xfs_bmap.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 97820c1..9c7227b 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -5524,6 +5524,8 @@ __xfs_bunmapi(
>                */
>               xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL);
>               xfs_trans_ijoin(tp, mp->m_rbmip, XFS_ILOCK_EXCL);
> +             xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL);
> +             xfs_trans_ijoin(tp, mp->m_rsumip, XFS_ILOCK_EXCL);

These need a lockdep annotations, right? i.e.

        xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL|XFS_ILOCK_RTBITMAP);
        xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL|XFS_ILOCK_RTSUM);

Because they are nested inside the inode ilock?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>