linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: lock the rt summary inode when unmapping realtime extents
@ 2016-06-29 20:02 Darrick J. Wong
  2016-06-29 20:20 ` Eric Sandeen
  2016-06-29 22:21 ` Dave Chinner
  0 siblings, 2 replies; 4+ messages in thread
From: Darrick J. Wong @ 2016-06-29 20:02 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

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@oracle.com>
---
 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);
 	}
 
 	extno = 0;

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: lock the rt summary inode when unmapping realtime extents
  2016-06-29 20:02 [PATCH] xfs: lock the rt summary inode when unmapping realtime extents Darrick J. Wong
@ 2016-06-29 20:20 ` Eric Sandeen
  2016-06-29 22:21 ` Dave Chinner
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2016-06-29 20:20 UTC (permalink / raw)
  To: xfs

On 6/29/16 3:02 PM, 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@oracle.com>

Makes sense to me; I wonder how/when/why this is/got/was broken....

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  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);
>  	}
>  
>  	extno = 0;
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: lock the rt summary inode when unmapping realtime extents
  2016-06-29 20:02 [PATCH] xfs: lock the rt summary inode when unmapping realtime extents Darrick J. Wong
  2016-06-29 20:20 ` Eric Sandeen
@ 2016-06-29 22:21 ` Dave Chinner
  2016-07-05  3:36   ` Darrick J. Wong
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2016-06-29 22:21 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs

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@oracle.com>
> ---
>  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@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: lock the rt summary inode when unmapping realtime extents
  2016-06-29 22:21 ` Dave Chinner
@ 2016-07-05  3:36   ` Darrick J. Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2016-07-05  3:36 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Thu, Jun 30, 2016 at 08:21:42AM +1000, Dave Chinner wrote:
> 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@oracle.com>
> > ---
> >  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?

Yes, they do, as does the other _ilock(rbmip) in xfs_bmap_util.c.
Will send updated patch.

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-05  3:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29 20:02 [PATCH] xfs: lock the rt summary inode when unmapping realtime extents Darrick J. Wong
2016-06-29 20:20 ` Eric Sandeen
2016-06-29 22:21 ` Dave Chinner
2016-07-05  3:36   ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).