Re: the "read" syscall sees partial effects of the "write" syscall

2020-09-20 Thread Dave Chinner
On Fri, Sep 18, 2020 at 03:13:17PM +0200, Jan Kara wrote: > On Fri 18-09-20 08:25:28, Mikulas Patocka wrote: > > I'd like to ask about this problem: when we write to a file, the kernel > > takes the write inode lock. When we read from a file, no lock is taken - > > thus the read syscall can read

Re: the "read" syscall sees partial effects of the "write" syscall

2020-09-18 Thread Linus Torvalds
On Fri, Sep 18, 2020 at 6:13 AM Jan Kara wrote: > > Yes, but no Linux filesystem (except for XFS AFAIK) follows the POSIX spec > in this regard. Yeah, and we never have. As you say, performance sucks, and nobody has ever cared. So the standard in this case is just something that we'll never foll

Re: the "read" syscall sees partial effects of the "write" syscall

2020-09-18 Thread Jan Kara
On Fri 18-09-20 08:25:28, Mikulas Patocka wrote: > I'd like to ask about this problem: when we write to a file, the kernel > takes the write inode lock. When we read from a file, no lock is taken - > thus the read syscall can read data that are halfway modified by the write > syscall. > > The s

the "read" syscall sees partial effects of the "write" syscall

2020-09-18 Thread Mikulas Patocka
Hi I'd like to ask about this problem: when we write to a file, the kernel takes the write inode lock. When we read from a file, no lock is taken - thus the read syscall can read data that are halfway modified by the write syscall. The standard specifies the effects of the write syscall are at