linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: David Howells <dhowells@redhat.com>
Cc: Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk>,
	Linus Torvalds <torvalds@osdl.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] permit fs->get_sb() to return alternative root
Date: Tue, 18 May 2004 10:43:14 -0400	[thread overview]
Message-ID: <1084891394.5215.6.camel@lade.trondhjem.org> (raw)
In-Reply-To: <6086.1084889689@redhat.com>

På ty , 18/05/2004 klokka 10:14, skreiv David Howells:
> Hi Al, Linux,
> 
> Here's a patch to add an extra argument to the get_sb() method of struct
> file_system_type that allows a filesystem to suggest an alternative dentry to
> be attached to the vfsmount structure. If no such suggestion is made,
> sb->s_root is selected as usual.

Cool..

> @@ -762,15 +763,18 @@
>  		}
>  	}
>  
> -	sb = type->get_sb(type, flags, name, data);
> +	root = NULL;
> +	sb = type->get_sb(type, flags, name, data, &root);
>  	if (IS_ERR(sb))
>  		goto out_free_secdata;
> +	if (!root)
> +		root = sb->s_root;
>   	error = security_sb_kern_mount(sb, secdata);
>   	if (error)
>   		goto out_sb;
>  	mnt->mnt_sb = sb;
> -	mnt->mnt_root = dget(sb->s_root);
> -	mnt->mnt_mountpoint = sb->s_root;
> +	mnt->mnt_root = dget(root);
> +	mnt->mnt_mountpoint = mnt->mnt_root;

This looks a bit iffy... Shouldn't that be

 +	if (!root)
 +		root = dget(sb->s_root);
....
 +	mnt->mnt_root = root;

Unless the filesystem has taken a reference to the dentry in "root", it
just won't be guaranteed to still exist.

Cheers,
  Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2004-05-18 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1084905576.5215.150.camel@lade.trondhjem.org>
2004-05-18 14:14 ` [PATCH] permit fs->get_sb() to return alternative root David Howells
2004-05-18 14:43   ` Trond Myklebust [this message]
     [not found]   ` <20040518152426.GY17014@parcelfarce.linux.theplanet.co.uk>
     [not found]     ` <1084895260.5215.22.camel@lade.trondhjem.org>
     [not found]       ` <20040518162812.GZ17014@parcelfarce.linux.theplanet.co.uk>
     [not found]         ` <1084898393.5215.43.camel@lade.trondhjem.org>
     [not found]           ` <Pine.LNX.4.58.0405180948190.25502@ppc970.osdl.org>
     [not found]             ` <1084899447.5215.49.camel@lade.trondhjem.org>
     [not found]               ` <20040518170410.GA17014@parcelfarce.linux.theplanet.co.uk>
     [not found]                 ` <1084902342.5215.94.camel@lade.trondhjem.org>
     [not found]                   ` <20040518174808.GD17014@parcelfarce.linux.theplanet.co.uk>
2004-05-20 11:22                     ` David Howells
2004-05-28  8:52                     ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1084891394.5215.6.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).