[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210124015905.GH740243@zeniv-ca>
Date: Sun, 24 Jan 2021 01:59:05 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Andres Freund <andres@...razel.de>
Cc: Lennert Buytenhek <buytenh@...tstofly.org>,
Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org,
io-uring@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-btrfs@...r.kernel.org
Subject: Re: [RFC PATCH] io_uring: add support for IORING_OP_GETDENTS64
On Sat, Jan 23, 2021 at 03:50:55PM -0800, Andres Freund wrote:
> As there's only a shared lock, seems like both would end up with the
> same ctx->pos and end up updating f_pos to the same offset (assuming the
> same count).
>
> Am I missing something?
This:
f = fdget_pos(fd);
if (!f.file)
return -EBADF;
in the callers. Protection of struct file contents belongs to struct file,
*not* struct inode. Specifically, file->f_pos_lock. *IF* struct file
in question happens to be shared and the file is a regular or directory
(sockets don't need any exclusion on read(2), etc.)
Powered by blists - more mailing lists