login
Header Space

 
 

Re: [PATCH 1/2][TAKE3] JBD: Fix race between free buffer and commit trasanction

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mingming <cmm@...>
Cc: <jack@...>, <pbadari@...>, <linux-ext4@...>, linux-kernel <linux-kernel@...>
Date: Thursday, May 22, 2008 - 1:57 am

On Wed, 21 May 2008 16:38:07 -0700 Mingming <cmm@us.ibm.com> wrote:

"fix race between buffer freeing and transaction commit", perhaps.


"latter"
"hold a reference on"


"journal_try_to_free_buffers"


"trying"


"held"


Unneeded initialisation.  Could just do

	transaction_t *transaction = journal->j_committing_transaction;


"the latter still holds a reference on the buffers"


"callers"
"request the"


"the flush"


Sorry about all the spelling flames ;) I'd normally just fix them
myself rather than typing them all into an email and having you type
them in again, etc.  But I think the patch needs to be respun anyway.

The mask-and-compare with GFP_KERNEL does appear to be correct, but it
is quite unusual.  Generally in a situation like this we will test for
the specific __GFP_foo flags which we're interested in.  For
documentation reasons if nothing else.

So the preferred form here would be

	if (ret == 0 &&
		(gfp_mask & (__GFP_WAIT|__GFP_FS)) == (__GFP_WAIT|__GFP_FS)) {

which really tells the reader what we're trying to do here.  And I
don't think this code cares about __GFP_IO, even though it would be
mighty peculirr (probably buggy) for someone to do
alloc_pages(__GFP_FS|__GFP_WAIT).



Did we actually need to hold j_state_lock across the
try_to_free_buffers() call here?  Because it'll increase hold times and
will introduce a lock-ranking dependency which we might not otherwise
have had (I didn't check).



Yup, that note is dead.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] JBD ordered mode rewrite, Jan Kara, (Thu Mar 6, 1:42 pm)
Possible race between direct IO and JBD?, Mingming Cao, (Fri Apr 25, 7:38 pm)
Re: Possible race between direct IO and JBD?, Jan Kara, (Mon Apr 28, 8:26 am)
Re: Possible race between direct IO and JBD?, Badari Pulavarty, (Mon Apr 28, 1:11 pm)
Re: Possible race between direct IO and JBD?, Jan Kara, (Mon Apr 28, 2:09 pm)
Re: Possible race between direct IO and JBD?, Mingming Cao, (Mon Apr 28, 3:09 pm)
Re: Possible race between direct IO and JBD?, Jan Kara, (Tue Apr 29, 8:43 am)
Re: [PATCH 1/2][TAKE3] JBD: Fix race between free buffer and..., Andrew Morton, (Thu May 22, 1:57 am)
Re: Possible race between direct IO and JBD?, Mingming Cao, (Tue Apr 29, 1:49 pm)
Re: Possible race between direct IO and JBD?, Andrew Morton, (Sat Apr 26, 6:41 am)
Re: [RFC] JBD ordered mode rewrite, Andreas Dilger, (Fri Mar 7, 7:52 pm)
Re: [RFC] JBD ordered mode rewrite, Jan Kara, (Mon Mar 10, 3:54 pm)
Re: [RFC] JBD ordered mode rewrite, Andreas Dilger, (Mon Mar 10, 5:37 pm)
Re: [RFC] JBD ordered mode rewrite, Christoph Hellwig, (Sat Mar 8, 8:14 am)
Re: [RFC] JBD ordered mode rewrite, Mingming Cao, (Fri Mar 7, 8:08 pm)
Re: [RFC] JBD ordered mode rewrite, Mingming Cao, (Fri Mar 7, 6:55 am)
Re: [RFC] JBD ordered mode rewrite, Jan Kara, (Mon Mar 10, 2:29 pm)
Re: [RFC] JBD ordered mode rewrite, Mark Fasheh, (Thu Mar 6, 9:34 pm)
Re: [RFC] JBD ordered mode rewrite, Jan Kara, (Mon Mar 10, 2:00 pm)
Re: [RFC] JBD ordered mode rewrite, Andrew Morton, (Thu Mar 6, 7:53 pm)
Re: [RFC] JBD ordered mode rewrite, Jan Kara, (Mon Mar 10, 1:38 pm)
Re: [RFC] JBD ordered mode rewrite, Josef Bacik, (Thu Mar 6, 3:05 pm)
Re: [RFC] JBD ordered mode rewrite, Jan Kara, (Mon Mar 10, 12:30 pm)
speck-geostationary