[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiAiGMH=bw5N1nOVWYkE9=Pcx+mxyMwjYfGEt+14hFOVQ@mail.gmail.com>
Date: Mon, 6 Apr 2020 10:04:11 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Dominique Martinet <asmadeus@...ewreck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
v9fs-developer@...ts.sourceforge.net,
Sergey Alirzaev <l29ah@...k.li>
Subject: Re: [GIT PULL] 9p update for 5.7
On Mon, Apr 6, 2020 at 9:46 AM Matthew Wilcox <willy@...radead.org> wrote:
>
> POSIX may well "allow" short reads, but userspace programmers basically
> never check the return value from read(). Short reads aren't actually
> allowed. That's why signals are only allowed to interrupt syscalls if
> they're fatal (and the application will never see the returned value
> because it's already dead).
Well, that's true for some applications.
But look at anybody who ever worked more with NFS mounts, and they got
used to having the 'intr' mount flag set and incomplete reads and
-EAGAIN as a result.
So a lot of normal applications are actually used to partial reads
even from file reads.
Are there apps that react badly? I'm sure - but they also wouldn't
have O_NONBLOCK set on a regular file. The only reason to set
O_NONBLOCK is because you think the fd might be a pipe or something,
and you _are_ ready to get partial reads.
So the 9p behavior certainly isn't outrageously out of line for a
network filesystem. In fact, because of O_NONBLOCK rather than a mount
option, I think it's a lot safer than a fairly standard NFS option.
Linus
Powered by blists - more mailing lists