Re: [PATCH] exfat: fdatasync flag should be same like generic_write_sync()

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

 



> > > --- a/fs/exfat/file.c
> > > +++ b/fs/exfat/file.c
> > > @@ -625,7 +625,7 @@ static ssize_t exfat_file_write_iter(struct kiocb *iocb,
> > > struct iov_iter *iter)
> > >
> > >        if (iocb_is_dsync(iocb) && iocb->ki_pos > pos) {
> > >                 ssize_t err = vfs_fsync_range(file, pos, iocb->ki_pos - 1,
> > > -                               iocb->ki_flags & IOCB_SYNC);
> > > +                               (iocb->ki_flags & IOCB_SYNC) ? 0 : 1);
> > 
> > How about calling generic_write_sync() instead of vfs_fsync_range(), like in
> > generic_file_write_iter()?
> The second arg of vfs_fsync_range "pos" maybe changed by valid_size (if pos > valid_size). 
> It can not replace by iocb->ki_pos - ret (ret by __generic_file_write_iter).
> So current way maybe better.

Here we synchronize the areas written by exfat_extend_valid_size() and
__generic_file_write_iter() if valid_size < pos.

The lengths of these two write areas are 'pos-valid_size' and 'ret'.
We can use generic_write_sync() and pass it the sum of these two lengths.

Of course, regardless of whether valid_size < pos, exfat_file_write_iter() only 
needs to return the length written by __generic_file_write_iter().




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux