Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1524068

Re: [PATCH] f2fs: fix fdatasync

From Jaegeuk Kim <jaegeuk@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] f2fs: fix fdatasync
Date 2016-11-17 04:50 +0100
Message-ID <sElS1-3EH-9@gated-at.bofh.it> (permalink)
References <sE7m1-2EG-23@gated-at.bofh.it> <sEdUt-70N-25@gated-at.bofh.it> <sEl5D-33A-3@gated-at.bofh.it> <sEl5D-33A-1@gated-at.bofh.it> <sElIm-3Bq-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 17, 2016 at 11:35:58AM +0800, Chao Yu wrote:
> On 2016/11/17 10:59, Jaegeuk Kim wrote:
> > On Thu, Nov 17, 2016 at 10:51:37AM +0800, Chao Yu wrote:
> >> Hi Jaegeuk,
> >>
> >> On 2016/11/17 3:13, Jaegeuk Kim wrote:
> >>> Hi Chao,
> >>>
> >>> On Wed, Nov 16, 2016 at 08:12:11PM +0800, Chao Yu wrote:
> >>>> For below two cases, we can't guarantee data consistence:
> >>>>
> >>>> a)
> >>>> 1. xfs_io "pwrite 0 4195328" "fsync"
> >>>> 2. xfs_io "pwrite 4195328 1024" "fdatasync"
> >>>> 3. godown
> >>>> 4. umount & mount
> >>>> --> isize we updated before fdatasync won't be recovered
> >>>>
> >>>> b)
> >>>> 1. xfs_io "pwrite -S 0xcc 0 4202496" "fsync"
> >>>> 2. xfs_io "fpunch 4194304 4096" "fdatasync"
> >>>> 3. godown
> >>>> 4. umount & mount
> >>>> --> dnode we punched before fdatasync won't be recovered
> >>>>
> >>>> The reason is that normally fdatasync won't be aware of modification
> >>>> of metadata in file, e.g. isize changing, dnode updating, so in ->fsync
> >>>> we will skip flushing node pages for above cases, result in making
> >>>> fdatasynced file being lost during recovery.
> >>>>
> >>>> Introduce FDATASYNC_INO global ino cache for tracking node changing,
> >>>> later fdatasync choose to flush nodes depend on ino cache state.
> >>>
> >>> We don't need to add this additionally, and would be better to consider other
> >>> major metadata as well.
> >>>
> >>> How about this?
> >>
> >> Seems it can't track file after evict?
> > 
> > Do we need that? That means inode page was already up-to-date?
> 
> I mean if node/data page of inode were writeback by kworker, after evict, if
> user open it again and call fdatasync, after sudden power-off, we will not
> recover it.

That will be handled by need_inode_block_update() below?

Thanks,

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] f2fs: fix fdatasync Chao Yu <yuchao0@huawei.com> - 2016-11-16 13:20 +0100
  Re: [PATCH] f2fs: fix fdatasync Christoph Hellwig <hch@infradead.org> - 2016-11-16 13:20 +0100
    Re: [PATCH] f2fs: fix fdatasync Chao Yu <yuchao0@huawei.com> - 2016-11-17 02:20 +0100
      Re: [PATCH] f2fs: fix fdatasync Jaegeuk Kim <jaegeuk@kernel.org> - 2016-11-17 03:40 +0100
  Re: [PATCH] f2fs: fix fdatasync Jaegeuk Kim <jaegeuk@kernel.org> - 2016-11-16 20:20 +0100
    Re: [PATCH] f2fs: fix fdatasync Jaegeuk Kim <jaegeuk@kernel.org> - 2016-11-17 04:00 +0100
      Re: [PATCH] f2fs: fix fdatasync Chao Yu <yuchao0@huawei.com> - 2016-11-17 04:40 +0100
        Re: [PATCH] f2fs: fix fdatasync Jaegeuk Kim <jaegeuk@kernel.org> - 2016-11-17 04:50 +0100
          Re: [PATCH] f2fs: fix fdatasync Chao Yu <yuchao0@huawei.com> - 2016-11-17 18:30 +0100
    Re: [PATCH] f2fs: fix fdatasync Chao Yu <yuchao0@huawei.com> - 2016-11-17 04:00 +0100

csiph-web