lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 May 2008 16:14:38 -0700
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	David Chinner <dgc@....com>
Cc:	Kentaro Makita <k-makita@...css.fujitsu.com>,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	akpm@...ux-foundation.org, viro@...IV.linux.org.uk
Subject: Re: [PATCH][RFC]fix soft lock up at NFS mount by per-SB LRU-list
	of unused dentries

On Fri, 2008-05-23 at 08:56 +1000, David Chinner wrote:
> On Thu, May 22, 2008 at 11:22:18AM +0900, Kentaro Makita wrote:
> > +/*
> > + * Shrink the dentry LRU on a given superblock.
> > + * @sb   : superblock to shrink dentry LRU.
> > + * @count: If count is NULL, we prune all dentries on superblock.
> > + * @flags: If flags is non-zero, we need to do special processing based on
> > + * which flags are set. This means we don't need to maintain multiple
> > + * similar copies of this loop.
> > + */
> > +static void __shrink_dcache_sb(struct super_block *sb, int *count, int flags)
> > +{
> > +	LIST_HEAD(referenced);
> > +	LIST_HEAD(tmp);
> > +	struct dentry *dentry;
> > +	int cnt = 0;
> > +
> > +	BUG_ON(!sb);
> > +	BUG_ON((flags & DCACHE_REFERENCED) && count == NULL);
> > +	spin_lock(&dcache_lock);
> > +	if (count != NULL)
> > +		/* called from prune_dcache() and shrink_dcache_parent() */
> > +		cnt = *count;
> 
> I'd convert all the 'if (count == NULL)' to 'if (!count)' and same
> for 'if (count != NULL)' to 'if (count)'....

It's a small thing, but in this case it almost makes sense to have the
explicit null to remind people it's a pointer....whenever people see
a variable named count, it's easy to assume it's an integer.

YMMV

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ