Re: [RFC] write(2) semantics wrt return values and current position

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

 



On Mon, Apr 06, 2015 at 08:04:01PM +0000, Drokin, Oleg wrote:
> Hello!
> 
> On Apr 6, 2015, at 12:02 PM, Al Viro wrote:
> > 	2) should we ever update the current position when write() returns 0?
> > IOW, what effect should zero-length write() on O_APPEND file have upon its
> > current position?  POSIX seems to imply that it should do nothing, and
> > generally that's what happens, but e.g. ext4 *does* update position to
> > the EOF, whether we will write anything or not.  So does FUSE when server
> > requests to bypass the page cache.  AFAICS, lustre is the same way,
> > but I might be missing something; everything else definitely does not
> 
> Lustre is not the same way.
> drivers/staging/lustre/lustre/llite/file.c::ll_file_io_generic() has this
>         if (io-> ci_nob > 0) {
>                 result = io->ci_nob;
>                 *ppos = io->u.ci_wr.wr.crw_pos;
>         }
> 
> and ppos is passed in as &iocb->ki_pos. ci_nob is number of bytes that we managed to read/write,
> and if it was 0 (either due to 0 bytes io request or due to error from the get go)
> we won't update it.

Eh? vvp_io_write_start():
                result = generic_file_write_iter(cio->cui_iocb, cio->cui_iter);
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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