[PATCH 05/14] fs: don't allow kernel reads and writes without iter ops

Linus Torvalds torvalds at linux-foundation.org
Sat Oct 10 12:03:31 AEDT 2020


On Fri, Oct 9, 2020 at 3:06 PM Eric Biggers <ebiggers at kernel.org> wrote:
>
> It's a bit unintuitive that ppos=NULL means "use pos 0", not "use file->f_pos".

That's not at all what it means.

A NULL ppos means "this has no position at all", and is what we use
for FMODE_STREAM file descriptors (ie sockets, pipes, etc).

It also means that we don't do the locking for position updates.

The fact that "ki_pos" gets set to zero is just because it needs to be
_something_. It shouldn't actually ever be used for stream devices.

                  Linus


More information about the Linuxppc-dev mailing list