linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to update dir's i_pino during cross_rename
Date: Fri, 8 Nov 2019 10:46:53 +0800	[thread overview]
Message-ID: <77ee5340-c9f5-d26e-16c5-5d471f0e78c1@huawei.com> (raw)
In-Reply-To: <20191107170519.GA766@sol.localdomain>

On 2019/11/8 1:05, Eric Biggers wrote:
> On Thu, Nov 07, 2019 at 02:12:05PM +0800, Chao Yu wrote:
>> As Eric reported:
>>
>> RENAME_EXCHANGE support was just added to fsstress in xfstests:
>>
>> 	commit 65dfd40a97b6bbbd2a22538977bab355c5bc0f06
>> 	Author: kaixuxia <xiakaixu1987@gmail.com>
>> 	Date:   Thu Oct 31 14:41:48 2019 +0800
>>
>> 	    fsstress: add EXCHANGE renameat2 support
>>
>> This is causing xfstest generic/579 to fail due to fsck.f2fs reporting errors.
>> I'm not sure what the problem is, but it still happens even with all the
>> fs-verity stuff in the test commented out, so that the test just runs fsstress.
>>
>> generic/579 23s ... 	[10:02:25]
>> [    7.745370] run fstests generic/579 at 2019-11-04 10:02:25
>> _check_generic_filesystem: filesystem on /dev/vdc is inconsistent
>> (see /results/f2fs/results-default/generic/579.full for details)
>>  [10:02:47]
>> Ran: generic/579
>> Failures: generic/579
>> Failed 1 of 1 tests
>> Xunit report: /results/f2fs/results-default/result.xml
>>
>> Here's the contents of 579.full:
>>
>> _check_generic_filesystem: filesystem on /dev/vdc is inconsistent
>> *** fsck.f2fs output ***
>> [ASSERT] (__chk_dots_dentries:1378)  --> Bad inode number[0x24] for '..', parent parent ino is [0xd10]
>>
>> The root cause is that we forgot to update directory's i_pino during
>> cross_rename, fix it.
>>
>> Fixes: 32f9bc25cbda0 ("f2fs: support ->rename2()")
>> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> 
> Tested-by: Eric Biggers <ebiggers@kernel.org>

Thanks for the test.

> 
> The i_pino field is only valid on directories, right?

i_pino is also valid on regular inode, because after sudden power-cut case, we
will recover fsynced file and link it into parent directory which i_pino field
points.

For rename/cross_rename cases, we just tag src/dst regular inode with
parent_lost flag instead of updating its i_pino field, once there is fsync()
comes after rename(), we will trigger checkpoint for such parent lost inode to
keep rename/cross_rename operation as an atomic operation.

Thanks,

> 
> - Eric
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2019-11-08  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07  6:12 [f2fs-dev] [PATCH] f2fs: fix to update dir's i_pino during cross_rename Chao Yu
2019-11-07 17:05 ` Eric Biggers
2019-11-08  2:46   ` Chao Yu [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=77ee5340-c9f5-d26e-16c5-5d471f0e78c1@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=ebiggers@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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).