Re: [PATCH] ceph: sync metadata when having I_DIRTY_DATASYNC flag in fdatasync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Sent: Monday, March 12, 2018 at 11:40 AM
> From: "Yan, Zheng" <ukernel@xxxxxxxxx>
> To: "Chengguang Xu" <cgxu519@xxxxxxx>
> Cc: "Zheng Yan" <zyan@xxxxxxxxxx>, "Ilya Dryomov" <idryomov@xxxxxxxxx>, ceph-devel <ceph-devel@xxxxxxxxxxxxxxx>
> Subject: Re: [PATCH] ceph: sync metadata when having I_DIRTY_DATASYNC flag in fdatasync
>
> On Sat, Mar 10, 2018 at 4:18 PM, Chengguang Xu <cgxu519@xxxxxxx> wrote:
> > When inode marks flag I_DIRTY_DATASYNC, even if fdatasync
> > should sync essential metadata.
> >
> > Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>
> > ---
> >  fs/ceph/caps.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> > index 0e5bd3e..6e08abb 100644
> > --- a/fs/ceph/caps.c
> > +++ b/fs/ceph/caps.c
> > @@ -2170,7 +2170,7 @@ int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync)
> >         if (ret < 0)
> >                 goto out;
> >
> > -       if (datasync)
> > +       if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
> >                 goto out;
> >
> >         inode_lock(inode);
> 
> The code in __ceph_mark_dirty_caps() that set I_DIRTY_DATASYNC should
> never be executed.  we never mark CEPH_CAP_FILE_BUFFER dirty. need
> check if that's a bug first

Hi Yan,

Thanks for your review.

I checked the calling places yesterday and there is no place to mark CEPH_CAP_FILE_BUFFER dirty
in current code, so if no chance to mark that in the future, then we can delete the related logic
in the __ceph_mark_dirty_caps().

I add another flag check in revised version of this patch, could you have a quick look at that part?


Thanks,
Chengguang.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux