All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: "bfields@fieldses.org" <bfields@fieldses.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v8 5/6] nfsd: add the infrastructure to handle the cld upcall
Date: Mon, 05 Mar 2012 18:53:27 +0400	[thread overview]
Message-ID: <4F54D367.4000503@parallels.com> (raw)
In-Reply-To: <20120305093948.435f39cc@tlielax.poochiereds.net>

05.03.2012 18:39, Jeff Layton пишет:
>
> Ok, I've started looking at the existing examples to try and ease the
> eventual containerization of this. Am I correct that the existing
> blocklayout pipe containerization is not yet complete?
>
> AIUI, you have a rpc_pipe per nfs_net struct, and those structs are
> allocated on a per-net basis. bl_pipe_downcall does this however:
>
>          if (copy_from_user(&bl_mount_reply, src, mlen) != 0)
>                  return -EFAULT;
>
> ...but bl_mount_reply is global:
>
>      static struct bl_dev_msg bl_mount_reply;
>
> So, if you're getting downcalls in two different network namespaces at
> the same time this could end up corrupt. It seems like bl_mount_reply
> needs to be part of nfs_net as well.

Thanks for this catch, Jeff!
I need to fix this.

>
> When you get a downcall, you have a filp pointer. Is there any way to
> determine the "correct" nfs_net object for a particular filp?
>

Yes, sure.
This nfs_net object will be, obviously, in the same network namespace, as PipeFS 
superblock. Network namespace is stored on PipeFS sb->s_fs_info.
IOW, code below should works:

struct nfs_net *nn = net_generic(file->f_dentry->d_sb->s_fs_info, nfs_net_id);

-- 
Best regards,
Stanislav Kinsbursky

  reply	other threads:[~2012-03-05 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 20:42 [PATCH v8 0/6] nfsd: overhaul the client name tracking code Jeff Layton
2012-03-02 20:42 ` [PATCH v8 1/6] nfsd: add nfsd4_client_tracking_ops struct and a way to set it Jeff Layton
2012-03-05  8:34   ` Stanislav Kinsbursky
2012-03-02 20:42 ` [PATCH v8 2/6] sunrpc: create nfsd dir in rpc_pipefs Jeff Layton
2012-03-02 20:42 ` [PATCH v8 3/6] nfsd: convert nfs4_client->cl_cb_flags to a generic flags field Jeff Layton
2012-03-02 20:42 ` [PATCH v8 4/6] nfsd: add a header describing upcall to nfsdcld Jeff Layton
2012-03-02 20:42 ` [PATCH v8 5/6] nfsd: add the infrastructure to handle the cld upcall Jeff Layton
2012-03-05  8:48   ` Stanislav Kinsbursky
2012-03-05 12:42     ` Jeff Layton
2012-03-05 12:51       ` Stanislav Kinsbursky
2012-03-05 14:39         ` Jeff Layton
2012-03-05 14:53           ` Stanislav Kinsbursky [this message]
2012-03-05 15:16             ` Jeff Layton
2012-03-05 15:48               ` Stanislav Kinsbursky
2012-03-02 20:42 ` [PATCH v8 6/6] nfsd: add notifier to handle mount/unmount of rpc_pipefs sb Jeff Layton

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=4F54D367.4000503@parallels.com \
    --to=skinsbursky@parallels.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@redhat.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.