From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: Daeho Jeong <daehojeong@google.com>,
kernel-team@android.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v3] f2fs: change the current atomic write way
Date: Tue, 24 May 2022 08:26:30 -0700 [thread overview]
Message-ID: <Yoz5JteVWWfZmOBp@google.com> (raw)
In-Reply-To: <227d10d5-2afe-acfa-7cfc-3a2f45331c6f@kernel.org>
On 05/24, Chao Yu wrote:
> On 2022/5/24 2:03, Jaegeuk Kim wrote:
> > On 05/22, Chao Yu wrote:
> > > On 2022/4/29 2:18, Daeho Jeong wrote:> + *old_addr = dn.data_blkaddr;
> > > > + f2fs_truncate_data_blocks_range(&dn, 1);
> > > > + dec_valid_block_count(sbi, F2FS_I(inode)->cow_inode, count);
> > > > + inc_valid_block_count(sbi, inode, &count);
> > > > + f2fs_replace_block(sbi, &dn, dn.data_blkaddr, new_addr,
> > > > + ni.version, true, false);
> > >
> > > My concern is, if cow_inode's data was persisted into previous checkpoint,
> > > and then f2fs_replace_block() will update SSA from cow_inode to inode?
> >
> > SSA for original file is intact, so we'll see the orignal file's block addresses
> > and SSA, if we flush cow_inode's SSA after committing the atomic writes?
> > It'd be good to flush any SSA for cow_inode, since we'll truncate
> > cow_inode after powercut by the ohphan recovery?
>
> I think it's safe for recovery flow, but before that, fsck will report inconsistent
> status during checking orphan atomic_write inode.
That should be fine as well, since it'll just drop that cow_inode.
>
> Thanks,
>
> >
> > > it will cause inconsistent status of last valid checkpoint? Or am I mssing
> > > something?
> > >
> > > > - f2fs_submit_merged_write_cond(sbi, inode, NULL, 0, DATA);
> > > > + new = f2fs_kmem_cache_alloc(revoke_entry_slab, GFP_NOFS,
> > > > + true, NULL);
> > > > + if (!new) {
> > > > + f2fs_put_dnode(&dn);
> > > > + ret = -ENOMEM;
> > > > + goto out;
> > >
> > > It doesn't need to handle failure of f2fs_kmem_cache_alloc()
> > > due to nofail parameter is true.
Let's get this by another patch. Could you please send one?
> > >
> > > Thanks,
> > >
> > >
> > > _______________________________________________
> > > Linux-f2fs-devel mailing list
> > > Linux-f2fs-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2022-05-24 15:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 18:18 [f2fs-dev] [PATCH v3] f2fs: change the current atomic write way Daeho Jeong
2022-05-22 12:43 ` Chao Yu
2022-05-23 18:03 ` Jaegeuk Kim
2022-05-24 6:29 ` Chao Yu
2022-05-24 15:26 ` Jaegeuk Kim [this message]
2023-03-31 14:22 ` Tudor Ambarus
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=Yoz5JteVWWfZmOBp@google.com \
--to=jaegeuk@kernel.org \
--cc=chao@kernel.org \
--cc=daehojeong@google.com \
--cc=kernel-team@android.com \
--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).