All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: unlock the AGI buffer when looping in xfs_dialloc
@ 2012-08-07  6:02 Christoph Hellwig
  2012-08-07 14:26 ` Mark Tinguely
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christoph Hellwig @ 2012-08-07  6:02 UTC (permalink / raw)
  To: xfs

Also update some commens in the area to make the code easier to read.

Signed-off-by: Christoph Hellwig <hch@lst.de>

---
 fs/xfs/xfs_ialloc.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Index: xfs/fs/xfs/xfs_ialloc.c
===================================================================
--- xfs.orig/fs/xfs/xfs_ialloc.c	2012-08-07 07:33:49.750001911 +0200
+++ xfs/fs/xfs/xfs_ialloc.c	2012-08-07 07:34:14.393335258 +0200
@@ -962,23 +962,22 @@ xfs_dialloc(
 		if (!pag->pagi_freecount && !okalloc)
 			goto nextag;
 
+		/*
+		 * Then read in the AGI buffer and recheck with the AGI buffer
+		 * lock held.
+		 */
 		error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
 		if (error)
 			goto out_error;
 
-		/*
-		 * Once the AGI has been read in we have to recheck
-		 * pagi_freecount with the AGI buffer lock held.
-		 */
 		if (pag->pagi_freecount) {
 			xfs_perag_put(pag);
 			goto out_alloc;
 		}
 
-		if (!okalloc) {
-			xfs_trans_brelse(tp, agbp);
-			goto nextag;
-		}
+		if (!okalloc)
+			goto nextag_relse_buffer;
+
 
 		error = xfs_ialloc_ag_alloc(tp, agbp, &ialloced);
 		if (error) {
@@ -1007,6 +1006,8 @@ xfs_dialloc(
 			return 0;
 		}
 
+nextag_relse_buffer:
+		xfs_trans_brelse(tp, agbp);
 nextag:
 		xfs_perag_put(pag);
 		if (++agno == mp->m_sb.sb_agcount)

_______________________________________________
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: unlock the AGI buffer when looping in xfs_dialloc
  2012-08-07  6:02 [PATCH] xfs: unlock the AGI buffer when looping in xfs_dialloc Christoph Hellwig
@ 2012-08-07 14:26 ` Mark Tinguely
  2012-08-09 23:49 ` Dave Chinner
  2012-08-16 20:53 ` Ben Myers
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Tinguely @ 2012-08-07 14:26 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On 08/07/12 01:02, Christoph Hellwig wrote:
> Also update some commens in the area to make the code easier to read.
>
> Signed-off-by: Christoph Hellwig<hch@lst.de>
>

Looks great. Just last weekend, I noticed that the unlock is also
missing in the current version of xfs_dialloc() and not just patch #7.

Reviewed-by: Mark Tinguely <tinguely@sgi.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: unlock the AGI buffer when looping in xfs_dialloc
  2012-08-07  6:02 [PATCH] xfs: unlock the AGI buffer when looping in xfs_dialloc Christoph Hellwig
  2012-08-07 14:26 ` Mark Tinguely
@ 2012-08-09 23:49 ` Dave Chinner
  2012-08-16 20:53 ` Ben Myers
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2012-08-09 23:49 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Tue, Aug 07, 2012 at 02:02:02AM -0400, Christoph Hellwig wrote:
> Also update some commens in the area to make the code easier to read.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
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: unlock the AGI buffer when looping in xfs_dialloc
  2012-08-07  6:02 [PATCH] xfs: unlock the AGI buffer when looping in xfs_dialloc Christoph Hellwig
  2012-08-07 14:26 ` Mark Tinguely
  2012-08-09 23:49 ` Dave Chinner
@ 2012-08-16 20:53 ` Ben Myers
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Myers @ 2012-08-16 20:53 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Hey Christoph,

On Tue, Aug 07, 2012 at 02:02:02AM -0400, Christoph Hellwig wrote:
> Also update some commens in the area to make the code easier to read.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

This seems to fix a regression that was introduced in

commit 55d6af64, 'xfs: refactor xfs_ialloc_ag_select'

Christoph, could you comment on why this has not caused problems in testing?  I
am sort of suprised we haven't had any ill effects.

I'll add this patch into our next pull request.

Thanks,
	Ben

_______________________________________________
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:[~2012-08-16 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07  6:02 [PATCH] xfs: unlock the AGI buffer when looping in xfs_dialloc Christoph Hellwig
2012-08-07 14:26 ` Mark Tinguely
2012-08-09 23:49 ` Dave Chinner
2012-08-16 20:53 ` Ben Myers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.