On 02/16/2017 02:21 PM, Christoph Hellwig wrote: > On Wed, Feb 15, 2017 at 10:11:38AM -0600, Goldwyn Rodrigues wrote: >>> I did not understand short writes. Where can I >>> get a short write? > > If you have a write request of N bytes, and you've already wrіtten > M of them you return M from the *write system call instead of -EAGAIN. > This is standard practice on e.g. sockets. Oh, I assume that would be taken care of in the existing code, at least with the modified patch. I will double check that anyways. > >>> >>> If I understand correctly, we do add the flag. >> >> Replying to myself to correct myself. >> >> On reading a bit more, I figured that we perform >> xfs_file_iomap_begin->xfs_iomap_write_direct. At this point we have >> already performed xfs_bmapi_read(). So, a check in xfs_file_iomap_begin >> should be good enough. So, the flag required would be with iomap flags, >> say IOMAP_NONBLOCKING. IOW, we don't need to go all the way to >> xfs_bmap_write() and return when imap.br_startblock == HOLESTARTBLOCK. > > Yes, except that reflinked files with shared extents will also need > some additional special casing - for those xfs_bmapi_read can return > an allocated extent, but we might still have to perform a block > allocation for a write. > Yes, I forgot that. I will put in a check for reflinks as well. -- Goldwyn -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html