Re: [PATCH 12/17] proc/fd: In fdinfo seq_show don't use get_files_struct

2020-08-18 Thread Christian Brauner
On Mon, Aug 17, 2020 at 05:04:20PM -0500, Eric W. Biederman wrote: > When discussing[1] exec and posix file locks it was realized that none > of the callers of get_files_struct fundamentally needed to call > get_files_struct, and that by switching them to helper functions > instead it will both sim

Re: [PATCH 12/17] proc/fd: In fdinfo seq_show don't use get_files_struct

2020-08-17 Thread Linus Torvalds
On Mon, Aug 17, 2020 at 6:13 PM Eric W. Biederman wrote: > > task_lock is needed to protect task->files. Hah. Right you are. I found a few cases where we didn't do that, but I hadn't noticed that they were all of the pattern struct task_struct *tsk = current; so "tsk->files" was safe fo

Re: [PATCH 12/17] proc/fd: In fdinfo seq_show don't use get_files_struct

2020-08-17 Thread Linus Torvalds
On Mon, Aug 17, 2020 at 3:11 PM Eric W. Biederman wrote: > > Instead hold task_lock for the duration that task->files needs to be > stable in seq_show. The task_lock was already taken in > get_files_struct, and so skipping get_files_struct performs less work > overall, and avoids the problems wit

[PATCH 12/17] proc/fd: In fdinfo seq_show don't use get_files_struct

2020-08-17 Thread Eric W. Biederman
When discussing[1] exec and posix file locks it was realized that none of the callers of get_files_struct fundamentally needed to call get_files_struct, and that by switching them to helper functions instead it will both simplify their code and remove unnecessary increments of files_struct.count.