All of lore.kernel.org
 help / color / mirror / Atom feed
From: Younger Liu <younger.liu@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH V2] ocfs2: need rollback when journal_access failed in ocfs2_orphan_add()
Date: Fri, 28 Jun 2013 14:30:27 +0800	[thread overview]
Message-ID: <51CD2D83.1050607@huawei.com> (raw)
In-Reply-To: <20130626144939.7c0a916c3bd507b3c6926e6a@linux-foundation.org>

On 2013/6/27 5:49, Andrew Morton wrote:
> On Thu, 20 Jun 2013 15:59:30 +0800 Younger Liu <younger.liu@huawei.com> wrote:
> 
>> While adding a file into orphan dir in ocfs2_orphan_add(),
>> it calls __ocfs2_add_entry() before ocfs2_journal_access_di(). 
>> If ocfs2_journal_access_di() failed, the file is added into 
>> orphan dir, and orphan dir dinode updated, but file dinode 
>> has not been updated.
>> Accordingly, the data is not consistent between file dinode 
>> and orphan dir.
>>
>> So, need to call ocfs2_journal_access_di() before __ocfs2_add_entry(),
>> and if ocfs2_journal_access_di() failed, orphan_fe and 
>> orphan_dir_inode->i_nlink need rollback. 
>>
>> --- a/fs/ocfs2/namei.c
>> +++ b/fs/ocfs2/namei.c
>> @@ -2012,6 +2012,21 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb,
> 
> ocfs2_orphan_add() will call mlog_errno(status) two times for the same
> error in many cases.  That's not a big problem, but is sloppy and asks
> for a cleanup.
> 
> 
> 
Thanks for your review, I will resent the patch in a moment.
					Younger 

      reply	other threads:[~2013-06-28  6:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  7:59 [Ocfs2-devel] [PATCH V2] ocfs2: need rollback when journal_access failed in ocfs2_orphan_add() Younger Liu
2013-06-20  8:46 ` Younger Liu
2013-06-26 21:49 ` Andrew Morton
2013-06-28  6:30   ` 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=51CD2D83.1050607@huawei.com \
    --to=younger.liu@huawei.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 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.