All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: need rollback when journal_access failed in ocfs2_orphan_add()
Date: Thu, 20 Jun 2013 09:42:02 +0800	[thread overview]
Message-ID: <51C25DEA.6060608@huawei.com> (raw)
In-Reply-To: <51C25A0E.8070702@huawei.com>

? 2013/6/20 9:25, Younger Liu ??:
> Hi Jeff
> 
> On 2013/6/19 18:53, Jeff Liu wrote:
>> Hey Younger,
>>
>> On 06/19/2013 04:57 PM, Younger Liu 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.
>>
>> Yes, and this has been introduced by commits 3939fda4.
> 
> I do not find the patch with 3939fda4. Can you tell me the link?
> Thanks.
> 

# git show 3939fda4
commit 3939fda4b389993caf8741df5739b3e49f33a263
Author: Tristan Ye <tristan.ye@oracle.com>
Date:   Fri Mar 19 09:21:09 2010 +0800

    Ocfs2: Journaling i_flags and i_orphaned_slot when adding inode to orphan dir.

    Currently, some callers were missing to journal the dirty inode after
    adding it to orphan dir.

    Now we're going to journal such modifications within the ocfs2_orphan_add()
    itself, It's safe to do so, though some existing caller may duplicate this,
    and it makes the logic look more straightforward anyway.

    Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
    Signed-off-by: Joel Becker <joel.becker@oracle.com>

  reply	other threads:[~2013-06-20  1:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19  8:57 [Ocfs2-devel] [PATCH] ocfs2: need rollback when journal_access failed in ocfs2_orphan_add() Younger Liu
2013-06-19 10:53 ` Jeff Liu
2013-06-20  1:25   ` Younger Liu
2013-06-20  1:42     ` Li Zefan [this message]
2013-06-20  5:52     ` Jeff Liu
2013-06-20  6:33       ` Younger Liu

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=51C25DEA.6060608@huawei.com \
    --to=lizefan@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.