LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory
Date: Fri, 27 Apr 2018 09:41:18 +0800 [thread overview]
Message-ID: <9e18815d-1ad0-51ae-512b-b5751dfe2e07@huawei.com> (raw)
In-Reply-To: <20180426153224.GE68594@jaegeuk-macbookpro.roam.corp.google.com>
On 2018/4/26 23:32, Jaegeuk Kim wrote:
> On 04/25, Chao Yu wrote:
>> On 2018/4/25 13:46, Jaegeuk Kim wrote:
>>> This is to give a option for user to be able to recover B/foo in the below
>>> case.
>>>
>>> mkdir A
>>> sync()
>>> rename(A, B)
>>> creat (B/foo)
>>> fsync (B/foo)
>>> ---crash---
>>
>> That makes sense, IMO, it will be better to cover cross rename case as well?
>
> file_lost_pino(old_inode) seems covering that.
Confirmed.
Thanks,
>
>>
>> Thanks,
>>
>>>
>>> Sugessted-by: Velayudhan Pillai <vijay@cs.utexas.edu>
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>>> ---
>>> fs/f2fs/namei.c | 5 ++++-
>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
>>> index b5f404674cad..fef6e3ab2135 100644
>>> --- a/fs/f2fs/namei.c
>>> +++ b/fs/f2fs/namei.c
>>> @@ -973,8 +973,11 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
>>> f2fs_put_page(old_dir_page, 0);
>>> f2fs_i_links_write(old_dir, false);
>>> }
>>> - if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
>>> + if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT) {
>>> add_ino_entry(sbi, new_dir->i_ino, TRANS_DIR_INO);
>>> + if (S_ISDIR(old_inode->i_mode))
>>> + add_ino_entry(sbi, old_inode->i_ino, TRANS_DIR_INO);
>>> + }
>>>
>>> f2fs_unlock_op(sbi);
>>>
>>>
>
> .
>
next prev parent reply other threads:[~2018-04-27 1:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 5:46 [PATCH 1/5] f2fs: give message and set need_fsck given broken node id Jaegeuk Kim
2018-04-25 5:46 ` [PATCH 2/5] f2fs: avoid bug_on on corrupted inode Jaegeuk Kim
2018-04-25 13:01 ` [f2fs-dev] " Chao Yu
2018-04-25 5:46 ` [PATCH 3/5] f2fs: sanity check on sit entry Jaegeuk Kim
2018-04-25 13:02 ` [f2fs-dev] " Chao Yu
2018-04-25 5:46 ` [PATCH 4/5] f2fs: sanity check for total valid blocks Jaegeuk Kim
2018-04-25 13:03 ` [f2fs-dev] " Chao Yu
2018-04-26 15:27 ` Jaegeuk Kim
2018-04-26 15:29 ` [f2fs-dev] [PATCH 4/5 v2] " Jaegeuk Kim
2018-04-27 1:52 ` Chao Yu
2018-04-25 5:46 ` [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory Jaegeuk Kim
2018-04-25 13:04 ` [f2fs-dev] " Chao Yu
2018-04-26 15:32 ` Jaegeuk Kim
2018-04-27 1:41 ` Chao Yu [this message]
2018-04-25 12:57 ` [f2fs-dev] [PATCH 1/5] f2fs: give message and set need_fsck given broken node id Chao Yu
2018-04-26 15:25 ` Jaegeuk Kim
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=9e18815d-1ad0-51ae-512b-b5751dfe2e07@huawei.com \
--to=yuchao0@huawei.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: [f2fs-dev] [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory' \
/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
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).