On Wed, Jul 01, 2020 at 10:08:28PM +0300, Amir Goldstein wrote: [..] > > diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c > > index 6918b98faeb6..970319ca1623 100644 > > --- a/fs/overlayfs/readdir.c > > +++ b/fs/overlayfs/readdir.c > > @@ -858,11 +858,15 @@ static int ovl_dir_fsync(struct file *file, loff_t start, loff_t end, > > struct ovl_dir_file *od = file->private_data; > > struct dentry *dentry = file->f_path.dentry; > > struct file *realfile = od->realfile; > > + struct ovl_fs *ofs = OVL_FS(dentry->d_sb); > > > > /* Nothing to sync for lower */ > > if (!OVL_TYPE_UPPER(ovl_path_type(dentry))) > > return 0; > > > > + if (ofs->config.nosync || ofs->config.syncfs) > > + return 0; > > + > > Generally looks good, but those test conditions are quite weird IMO. > I would go for either enum or flags, but not up to me to decide. > But at the very least use inline helpers ovl_should_fsync(), > ovl_should_syncfs(), because if we want to add new sync modes or > whatever going over all those conditions and > changing them would be sub-optimal. Ok, I will add inline helpers. I am not sure, what will I gain by switching to using enums or flags. It will be just different style to keep same information. Thanks Vivek