All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v3 2/3] f2fs: inline: remove redundant FI_DATA_EXIST set
Date: Tue, 8 Dec 2020 18:51:08 -0800	[thread overview]
Message-ID: <X9A7nBfnbVa8Ee1F@google.com> (raw)
In-Reply-To: <cbff5c7d-26c4-da2d-f706-54e7441b9855@huawei.com>

On 12/09, Chao Yu wrote:
> On 2020/12/8 15:07, Jaegeuk Kim wrote:
> > On 12/08, Chao Yu wrote:
> > > On 2020/12/8 9:38, Jaegeuk Kim wrote:
> > > > On 12/08, Chao Yu wrote:
> > > > > On 2020/12/8 0:49, Jaegeuk Kim wrote:
> > > > > > On 12/07, Jack Qiu wrote:
> > > > > > > FI_DATA_EXIST has been set in recover_inline_flags, no need set in
> > > > > > > f2fs_recover_inline_data again. Just remove it.
> > > > > > > 
> > > > > > > Signed-off-by: Jack Qiu <jack.qiu@huawei.com>
> > > > > > > ---
> > > > > > >     fs/f2fs/inline.c | 1 -
> > > > > > >     1 file changed, 1 deletion(-)
> > > > > > > 
> > > > > > > diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
> > > > > > > index 0399531efcd3..0a8f7eefca7d 100644
> > > > > > > --- a/fs/f2fs/inline.c
> > > > > > > +++ b/fs/f2fs/inline.c
> > > > > > > @@ -286,7 +286,6 @@ int f2fs_recover_inline_data(struct inode *inode, struct page *npage)
> > > > > > >     		memcpy(dst_addr, src_addr, MAX_INLINE_DATA(inode));
> > > > > > > 
> > > > > > >     		set_inode_flag(inode, FI_INLINE_DATA);
> > > > > > > -		set_inode_flag(inode, FI_DATA_EXIST);
> > > > > > 
> > > > > > Wait, recover_inline_flags() sets this based on on-disk flag, but this tries to
> > > > > > recover it back.
> > > > > 
> > > > > Should this flag only be recovered with the way like __recover_inline_status()?
> > > > > otherwise, the data_exist status may be not be consistent with real condition.
> > > > 
> > > > Well, we cannot say consistency on this, since user can write zero data. This
> > > 
> > > I can see that FI_DATA_EXIST flag only decide that whether f2fs_convert_inline_page()
> > > will copy inline data into first page, if user write all zero data in inline area,
> > > there is no need to do the copy, as first page contains all zero already.
> > > 
> > > So, IMO, the flag indicates more like a FI_NON_ZERO_DATA_EXIST status? that would be
> > > consistent with our implementation in __recover_inline_status().
> > 
> > IIRC, original intention is FI_DATA_EXIST, and non-zero case was added to avoid
> > potential inconsistency case. So, it's not intened for FI_NON_ZERO_DATA_EXIST.
> 
> Why we can encounter such inconsistency? is there any bug before adding that patch?

I can't remember exactly on it.

> 
> > Still I don't see any problem on this, but  looking at the iteration overhead on
> >     do_read_inode() -> __recover_inlint_status().
> 
> Yup, it's trivial, I'm fine to keep it as it is.
> 
> Thanks,
> 
> > 
> > > 
> > > Thanks,
> > > 
> > > > can avoid __recover_inline_state() regardless of there-in data which is zero or
> > > > not.
> > > > 
> > > > > 
> > > > > Thanks,
> > > > > 
> > > > > > 
> > > > > > > 
> > > > > > >     		set_page_dirty(ipage);
> > > > > > >     		f2fs_put_page(ipage, 1);
> > > > > > > --
> > > > > > > 2.17.1
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > _______________________________________________
> > > > > > > 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
> > > > > > .
> > > > > > 
> > > > .
> > > > 
> > .
> > 


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

  reply	other threads:[~2020-12-09  2:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 12:01 [f2fs-dev] [PATCH v3 0/3] f2fs: inline: fix minor bugs in f2fs_recover_inline_data Jack Qiu
2020-12-07 12:01 ` [f2fs-dev] [PATCH v3 1/3] f2fs: inline: correct comment " Jack Qiu
2020-12-07 12:01 ` [f2fs-dev] [PATCH v3 2/3] f2fs: inline: remove redundant FI_DATA_EXIST set Jack Qiu
2020-12-07 14:47   ` Chao Yu
2020-12-07 16:49   ` Jaegeuk Kim
2020-12-08  1:25     ` Chao Yu
2020-12-08  1:38       ` Jaegeuk Kim
2020-12-08  2:15         ` Chao Yu
2020-12-08  7:07           ` Jaegeuk Kim
2020-12-09  1:31             ` Chao Yu
2020-12-09  2:51               ` Jaegeuk Kim [this message]
2020-12-07 12:01 ` [f2fs-dev] [PATCH v3 3/3] f2fs: inline: fix wrong inline inode stat Jack Qiu

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=X9A7nBfnbVa8Ee1F@google.com \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=yuchao0@huawei.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.