Re: write() semantics (Re: Orangefs ABI documentation)

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

 



On Sat, Jan 23, 2016 at 2:46 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> What should we get?  -EINTR, despite having written some data?

No, that's not acceptable.

Either all or nothing (which is POSIX) or the NFS 'intr' mount
behavior (partial write return, -EINTR only when nothing was written
at all). And, like NFS, a mount option might be a good thing.

And of course, for the usual reasons, fatal signals are special in
that for them we generally say "screw posix, nobody sees the return
value anyway", but even there the filesystem might as well still
return the partial return value (just to not introduce yet another
special case).

In fact, I think that with our "fatal signals interrupt" behavior,
nobody should likely use the "intr" mount option on NFS. Even if the
semantics may be "better", there are likely simply just too many
programs that don't check the return value of "write()" at all, much
less handle partial writes correctly.

(And yes, our "screw posix" behavior wrt fatal signals is strictly
wrong even _despite_ the fact that nobody sees the return value -
other processes can still obviously see that the whole write wasn't
done. But blocking on a fatal signal is _so_ annoying that it's one of
those things where we just say "posix was wrong on this one, and if we
squint a bit we look _almost_ like we're compliant").

              Linus
--
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