All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2] SUNRPC: Fix validity issues with rpc_pipefs sb->s_fs_info
Date: Fri, 9 Nov 2012 11:59:38 +0400	[thread overview]
Message-ID: <509CB7EA.5000106@parallels.com> (raw)
In-Reply-To: <1352393506-39590-1-git-send-email-Trond.Myklebust@netapp.com>

Acked-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

08.11.2012 20:51, Trond Myklebust пишет:
> rpc_kill_sb() must defer calling put_net() until after the notifier
> has been called, since most (all?) of the notifier callbacks assume
> that sb->s_fs_info points to a valid net namespace. It also must not
> call put_net() if the call to rpc_fill_super was unsuccessful.
>
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
> Cc: stable@vger.kernel.org [>= v3.4]
> ---
>   net/sunrpc/rpc_pipe.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> index 21fde99..2a419f1 100644
> --- a/net/sunrpc/rpc_pipe.c
> +++ b/net/sunrpc/rpc_pipe.c
> @@ -1152,14 +1152,19 @@ static void rpc_kill_sb(struct super_block *sb)
>   	struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
>
>   	mutex_lock(&sn->pipefs_sb_lock);
> +	if (sn->pipefs_sb != sb) {
> +		mutex_unlock(&sn->pipefs_sb_lock);
> +		goto out;
> +	}
>   	sn->pipefs_sb = NULL;
>   	mutex_unlock(&sn->pipefs_sb_lock);
> -	put_net(net);
>   	dprintk("RPC:	sending pipefs UMOUNT notification for net %p%s\n", net,
>   								NET_NAME(net));
>   	blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
>   					   RPC_PIPEFS_UMOUNT,
>   					   sb);
> +	put_net(net);
> +out:
>   	kill_litter_super(sb);
>   }
>
>


-- 
Best regards,
Stanislav Kinsbursky

      reply	other threads:[~2012-11-09  7:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08 16:51 [PATCH v2] SUNRPC: Fix validity issues with rpc_pipefs sb->s_fs_info Trond Myklebust
2012-11-09  7:59 ` Stanislav Kinsbursky [this message]

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=509CB7EA.5000106@parallels.com \
    --to=skinsbursky@parallels.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.