ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
From: Younger Liu <younger.liucn@gmail.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [patch 1/8] ocfs2: alloc_dinode counts and group bitmap should be update simultaneously
Date: Mon, 31 Mar 2014 09:35:01 +0800	[thread overview]
Message-ID: <5338C645.80307@gmail.com> (raw)
In-Reply-To: <20140330224436.GB4488@wotan.suse.de>

On 2014/3/31 6:44, Mark Fasheh wrote:
> On Wed, Mar 19, 2014 at 02:09:59PM -0700, Andrew Morton wrote:
>> From: Younger Liu <younger.liucn@gmail.com>
>> Subject: ocfs2: alloc_dinode counts and group bitmap should be update simultaneously
>>
>> Updating alloc_dinode counts in ocfs2_alloc_dinode_update_counts() and
>> setting group bitmap in ocfs2_alloc_dinode_update_bitmap() have to be done
>> simultaneously.  Two cases are as follow:
>>
>> (1) If ocfs2_alloc_dinode_update_counts() fails, there is no need to
>>     set group bitmap.  This case has been considered.
>>
>> (2) If ocfs2_alloc_dinode_update_bitmap() fails, alloc_dinode counts
>>     should be rolled back.  Otherwise, some clusters would never be used. 
>>     This case is not considered.
>>
>> So, we combine two functions, and ensure simultaneity.
> 
> By 'ocfs2_alloc_dinode_update_bitmap' above, you mean
> ocfs2_block_group_set_bits() correct? I am going under that assumption.
> 
> 
> Anyway, I believe you're trying to fix a rare case where we might leak some
> space in that our chain counts might be a bit high. Basically the call to
> journal_access() in ocfs2_block_group_set_bits() has to fail. To be honest,
> this has existed for a while and hasn't ever been an issue.
> 
> That said, we can fix it but I don't like that your approach changes core
> bitmap handling code. Can you please do this by writing a simple fallback
> function to set the correct values on the bitmap dinode? Have that called in
> case of error from ocfs2_block_group_set_bits(). It doesn't need to make
> journal calls because that has already been set up for it so this is
> literally a couple lines of code.
> 
> If you like, you can take the pattern of:
> 
> call ocfs2_alloc_dinode_update_counts()
> call ocfs2_block_group_set_bits()
> if (error)
>    call ocfs2_rollback_alloc_dinode_counts()
>    ...
> 
> And put that into a master function.
> 
Hi Mark,
  Thanks for your review.
  It is not a good idea to change core code. I will resend a patch in a
monent.
     Younger
> Thanks,
> 	--Mark
> 
> 
> --
> Mark Fasheh
> 
> 

      reply	other threads:[~2014-03-31  1:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 21:09 [Ocfs2-devel] [patch 1/8] ocfs2: alloc_dinode counts and group bitmap should be update simultaneously akpm at linux-foundation.org
2014-03-30 22:44 ` Mark Fasheh
2014-03-31  1:35   ` Younger Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5338C645.80307@gmail.com \
    --to=younger.liucn@gmail.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).