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]
Message-ID: <20070504072734.GA21188@infradead.org>
Date:	Fri, 4 May 2007 08:27:34 +0100
From:	Christoph Hellwig <hch@...radead.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Josef Sipek <jsipek@...sunysb.edu>, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, hch@...radead.org,
	viro@....linux.org.uk, Trond.Myklebust@...app.com,
	mhalcrow@...ibm.com
Subject: Re: [PATCH 1/1] fs: add 4th case to do_path_lookup

sorry, I proposed Jeff a reply long ago but haven't done yet.

On Fri, May 04, 2007 at 12:02:00AM -0700, Andrew Morton wrote:
> > @@ -1125,6 +1125,10 @@ static int fastcall do_path_lookup(int dfd, const char *name,
> >  		nd->mnt = mntget(fs->rootmnt);
> >  		nd->dentry = dget(fs->root);
> >  		read_unlock(&fs->lock);
> > +	} else if (flags & LOOKUP_ONE) {
> > +		/* nd->mnt and nd->dentry already set, just grab references */
> > +		mntget(nd->mnt);
> > +		dget(nd->dentry);
> >  	} else if (dfd == AT_FDCWD) {
> >  		read_lock(&fs->lock);
> >  		nd->mnt = mntget(fs->pwdmnt);
> 
> Well the patch passes my too-small-to-care-about test ;)
> 
> Unless someone objects I'd suggest that you add it to the unionfs tree.

The code is obviously correct.  There is one little thing that bothers
me, and that's that nd was purely an output paramter to path_lookup and
do_path_lookup, and no it's an input paramter for the least used case.
It might make sense to just a simple helper ala:



static int path_component_lookup(struct dentry *dentry, struct vfsmount *mnt,
		const char *name, unsigned int flags, struct nameidata *nd)
{
	int retval;

	nd->last_type = LAST_ROOT;
	nd->flags = flags;
	nd->mnt = mntget(mnt);
	nd->dentry = dget(dentry);
	nd->depth = 0;

	retval = path_walk(name, nd);
	if (unlikely(!retval && !audit_dummy_context() &&
	             nd->dentry && nd->dentry->d_inode))
		audit_inode(name, nd->dentry->d_inode);

	return retval;

}

instead.
-
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