On Fri, Aug 30, 2024 at 03:04:59PM +0200, Christian Brauner wrote: > Only regular files with FMODE_ATOMIC_POS and directories need > f_pos_lock. Place a new f_pipe member in a union with f_pos_lock > that they can use and make them stop abusing f_version in follow-up > patches. Not sure I like that - having lseek(2) use a separate primitive instead of fdget_pos(), grabbing ->f_pos_lock for _everything_ that has FMODE_LSEEK, directory or no directory, would simplify quite a few things. OTOH, that will affect only the explanation of validity - pipes do *not* have FMODE_LSEEK, so it becomes "fdget_pos() and fdget_seek() are the only things that might want ->f_pos_lock, and neither touch it for pipes - fdget_pos() because FMODE_ATOMIC_POS is not there and fdget_seek() because FMODE_LSEEK isn't". Oh, well...