On 10:11 05/08, Dave Chinner wrote:
> On Fri, Aug 02, 2019 at 05:00:39PM -0500, Goldwyn Rodrigues wrote:
> > From: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>
> >
> > Introduce a new btrfs_iomap structure which contains information
> > about the filesystem between the iomap_begin() and iomap_end() calls.
> > This contains information about reservations and extent locking.
> >
> > This one is a long patch. Most of the code is "inspired" by
> > fs/btrfs/file.c. To keep the size small, all removals are in
> > following patches.
>
> I can't comment on the btrfs code but this:
>
> > +size_t btrfs_buffered_iomap_write(struct kiocb *iocb, struct iov_iter *from)
> > +{
> > + ssize_t written;
> > + struct inode *inode = file_inode(iocb->ki_filp);
> > + written = iomap_file_buffered_write(iocb, from, &btrfs_buffered_iomap_ops);
> > + if (written > 0)
> > + iocb->ki_pos += written;
> > + if (iocb->ki_pos > i_size_read(inode))
> > + i_size_write(inode, iocb->ki_pos);
> > + return written;
>
> Looks like it fails to handle O_[D]SYNC writes.
>
It does in btrfs_file_write_iter(), which calls btrfs_buffered_iomap_write().
btrfs_file_write_iter() calls generic_write_sync().
--
Goldwyn