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 > -- > 1.8.3.1 > > -- > 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 -- 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