diff mbox

[RFC,PATCHES] reducing d_add() use, part 3 (procfs)

Message ID 20180526182021.GQ30522@ZenIV.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Al Viro May 26, 2018, 6:20 p.m. UTC
On Sat, May 26, 2018 at 04:56:40PM +0300, Alexey Dobriyan wrote:
> On Sat, May 26, 2018 at 04:07:26PM +0300, Alexey Dobriyan wrote:
> > On Sat, May 26, 2018 at 01:03:02AM +0100, Al Viro wrote:
> > > On Sat, May 26, 2018 at 12:53:26AM +0100, Al Viro wrote:
> > 
> > > ... and a lot more convoluted ones - procfs side.
> > > I would really like an ACK/NAK from Alexey on that part...
> > 
> > Is /proc part self contained? This happens with 5 patches against mainline:
> > 
> > Welcome to Debian GNU/Linux 8 (jessie)!
> > 
> > [    0.764706] systemd[1]: Failed to insert module 'autofs4'
> > [    0.765357] systemd[1]: Failed to insert module 'ipv6'
> > [    0.766047] systemd[1]: Set hostname to <debian88>.
> > [    0.778266] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read)
> > [    0.785611] random: systemd: uninitialized urandom read (16 bytes read)
> > [    0.790655] ------------[ cut here ]------------
> 
> Regardless, the broken patch is
> "[PATCH 3/5] don't bother with tid_fd_revalidate() in lookups".

D'oh...  Incremental would be

Comments

Matthew Wilcox May 26, 2018, 6:38 p.m. UTC | #1
On Sat, May 26, 2018 at 07:20:21PM +0100, Al Viro wrote:
> D'oh...  Incremental would be
> 
> diff --git a/fs/proc/fd.c b/fs/proc/fd.c
> index 694faeacf42f..f5de22a9e9e0 100644
> --- a/fs/proc/fd.c
> +++ b/fs/proc/fd.c
> @@ -247,15 +247,15 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx,
>  	for (fd = ctx->pos - 2;
>  	     fd < files_fdtable(files)->max_fds;
>  	     fd++, ctx->pos++) {
> -		struct file *file;
> +		struct file *f;

Ugh.  -Wshadow doesn't get turned on until W=2 which is really damn noisy.
It's going to take a _lot_ of work to move that over into W=1 or even
set by default.
diff mbox

Patch

diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 694faeacf42f..f5de22a9e9e0 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -247,15 +247,15 @@  static int proc_readfd_common(struct file *file, struct dir_context *ctx,
 	for (fd = ctx->pos - 2;
 	     fd < files_fdtable(files)->max_fds;
 	     fd++, ctx->pos++) {
-		struct file *file;
+		struct file *f;
 		struct fd_data data;
 		char name[10 + 1];
 		int len;
 
-		file = fcheck_files(files, fd);
-		if (!file)
+		f = fcheck_files(files, fd);
+		if (!f)
 			continue;
-		data.mode = file->f_mode;
+		data.mode = f->f_mode;
 		rcu_read_unlock();
 		data.fd = fd;