[Devel] [PATCH RHEL7 COMMIT] Revert "VE/VFS: use sb->s_ns member to store namespace for mount_ns() calls"

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 28 05:42:42 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.3
------>
commit 9b72ce16b191d84da03da83d5ccec29de8854686
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Fri Aug 28 16:42:41 2015 +0400

    Revert "VE/VFS: use sb->s_ns member to store namespace for mount_ns() calls"
    
    Patchset description:
    
    zap sb->s_ns + fix memleak in binfmt_misc
    
    Vladimir Davydov (6):
      binfmt_misc: do not use sb->s_fs_info
      Revert "VE/VFS: use sb->s_ns member to store namespace for mount_ns()
        calls"
      Revert "ve/sunrpc: use correct pointer to net_namespace in auth_gss.c"
      Revert "nfsd/sunrpc/mqueue: use sb->s_ns instead of data in
        fill_super"
      binfmt_misc: do not use s_ns
      binfmt_misc: destroy all nodes on ve stop
    
    https://jira.sw.ru/browse/PSBM-39154
    
    Reviewed-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
    
    ======================
    This patch description:
    
    This reverts commit 9e7411c5c3b53937171ef962ce7381337f125b28.
    
    This patch is not longer needed, because none of the mount_ns users
    needs sb->s_fs_info any more.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 fs/nfs/dns_resolve.c  | 2 +-
 fs/nfsd/nfs4recover.c | 4 ++--
 fs/super.c            | 4 ++--
 include/linux/fs.h    | 2 --
 ipc/mqueue.c          | 6 +++---
 net/sunrpc/clnt.c     | 2 +-
 net/sunrpc/rpc_pipe.c | 4 ++--
 7 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index dda6202..d25f10f 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -415,7 +415,7 @@ static int rpc_pipefs_event(struct notifier_block *nb, unsigned long event,
 			   void *ptr)
 {
 	struct super_block *sb = ptr;
-	struct net *net = sb->s_ns;
+	struct net *net = sb->s_fs_info;
 	struct nfs_net *nn = net_generic(net, nfs_net_id);
 	struct cache_detail *cd = nn->nfs_dns_resolve;
 	int ret = 0;
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index c714602..4c86b18 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -693,7 +693,7 @@ cld_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
 	struct cld_upcall *tmp, *cup;
 	struct cld_msg __user *cmsg = (struct cld_msg __user *)src;
 	uint32_t xid;
-	struct nfsd_net *nn = net_generic(filp->f_dentry->d_sb->s_ns,
+	struct nfsd_net *nn = net_generic(filp->f_dentry->d_sb->s_fs_info,
 						nfsd_net_id);
 	struct cld_net *cn = nn->cld_net;
 
@@ -1353,7 +1353,7 @@ static int
 rpc_pipefs_event(struct notifier_block *nb, unsigned long event, void *ptr)
 {
 	struct super_block *sb = ptr;
-	struct net *net = sb->s_ns;
+	struct net *net = sb->s_fs_info;
 	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 	struct cld_net *cn = nn->cld_net;
 	struct dentry *dentry;
diff --git a/fs/super.c b/fs/super.c
index c9b47bf..341650d 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -880,12 +880,12 @@ EXPORT_SYMBOL(kill_litter_super);
 
 static int ns_test_super(struct super_block *sb, void *data)
 {
-	return sb->s_ns == data;
+	return sb->s_fs_info == data;
 }
 
 static int ns_set_super(struct super_block *sb, void *data)
 {
-	sb->s_ns = data;
+	sb->s_fs_info = data;
 	return set_anon_super(sb, NULL);
 }
 
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 68cec28..553bca3 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1457,8 +1457,6 @@ struct super_block {
 	unsigned int		s_max_links;
 	fmode_t			s_mode;
 
-	void			*s_ns;		/* Pointer to namespace */
-
 	/* Granularity of c/m/atime in ns.
 	   Cannot be worse than a second */
 	u32		   s_time_gran;
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 18620cd..c508938 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -104,7 +104,7 @@ static inline struct mqueue_inode_info *MQUEUE_I(struct inode *inode)
  */
 static inline struct ipc_namespace *__get_ns_from_inode(struct inode *inode)
 {
-	return get_ipc_ns(inode->i_sb->s_ns);
+	return get_ipc_ns(inode->i_sb->s_fs_info);
 }
 
 static struct ipc_namespace *get_ns_from_inode(struct inode *inode)
@@ -407,7 +407,7 @@ static void mqueue_evict_inode(struct inode *inode)
 		user->mq_bytes -= mq_bytes;
 		/*
 		 * get_ns_from_inode() ensures that the
-		 * (ipc_ns = sb->s_ns) is either a valid ipc_ns
+		 * (ipc_ns = sb->s_fs_info) is either a valid ipc_ns
 		 * to which we now hold a reference, or it is NULL.
 		 * We can't put it here under mq_lock, though.
 		 */
@@ -1418,7 +1418,7 @@ int mq_init_ns(struct ipc_namespace *ns)
 
 void mq_clear_sbinfo(struct ipc_namespace *ns)
 {
-	ns->mq_mnt->mnt_sb->s_ns = NULL;
+	ns->mq_mnt->mnt_sb->s_fs_info = NULL;
 }
 
 void mq_put_mnt(struct ipc_namespace *ns)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 6a03cf0..488ddee 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -241,7 +241,7 @@ static int rpc_pipefs_event(struct notifier_block *nb, unsigned long event,
 	struct rpc_clnt *clnt;
 	int error = 0;
 
-	while ((clnt = rpc_get_client_for_event(sb->s_ns, event))) {
+	while ((clnt = rpc_get_client_for_event(sb->s_fs_info, event))) {
 		error = __rpc_pipefs_event(clnt, event, sb);
 		if (error)
 			break;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 875f9c7..b8f6185 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1428,7 +1428,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
 					   sb);
 	if (err)
 		goto err_depopulate;
-	sb->s_ns = get_net(net);
+	sb->s_fs_info = get_net(net);
 	mutex_unlock(&sn->pipefs_sb_lock);
 	return 0;
 
@@ -1462,7 +1462,7 @@ rpc_mount(struct file_system_type *fs_type,
 
 static void rpc_kill_sb(struct super_block *sb)
 {
-	struct net *net = sb->s_ns;
+	struct net *net = sb->s_fs_info;
 	struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
 
 	mutex_lock(&sn->pipefs_sb_lock);



More information about the Devel mailing list