Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

close_files(): don't bother with xchg()

At that point nobody else has references to the victim files_struct;
as the matter of fact, the caller will free it immediately after
close_files() returns, with no RCU delays or anything of that sort.

That's why we are not protecting against fdtable reallocation on
expansion, not cleaning the bitmaps, etc. There's no point
zeroing the pointers in ->fd[] either, let alone make that an
atomic operation.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 1fa4ffd8 be5498ca

+1 -1
+1 -1
fs/file.c
··· 413 413 set = fdt->open_fds[j++]; 414 414 while (set) { 415 415 if (set & 1) { 416 - struct file * file = xchg(&fdt->fd[i], NULL); 416 + struct file *file = fdt->fd[i]; 417 417 if (file) { 418 418 filp_close(file, files); 419 419 cond_resched();