Whamcloud - gitweb
LU-1919 mount: do not access vfs mnt directly
authorAlex Zhuravlev <bzzz@whamcloud.com>
Thu, 13 Sep 2012 16:24:20 +0000 (20:24 +0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 17 Sep 2012 17:52:51 +0000 (13:52 -0400)
from obd_mount.c - it's under OSD control now and at umount time
the structure can disappear with OSD, sooner then lustre umount
is completed.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I91bae528bc229cd4e0e191e61eae8a7854494c8f
Reviewed-on: http://review.whamcloud.com/3982
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/obdclass/obd_mount.c

index b2ec636..b193034 100644 (file)
@@ -121,9 +121,7 @@ static int server_register_mount(const char *name, struct super_block *sb,
 
         cfs_mutex_unlock(&lustre_mount_info_lock);
 
-        CDEBUG(D_MOUNT, "reg_mnt %p from %s, vfscount=%d\n",
-              lmi->lmi_mnt, name,
-              lmi->lmi_mnt ? mnt_get_count(lmi->lmi_mnt) : -1);
+       CDEBUG(D_MOUNT, "reg_mnt %p from %s\n", lmi->lmi_mnt, name);
 
         RETURN(0);
 }
@@ -142,9 +140,7 @@ static int server_deregister_mount(const char *name)
                 RETURN(-ENOENT);
         }
 
-        CDEBUG(D_MOUNT, "dereg_mnt %p from %s, vfscount=%d\n",
-              lmi->lmi_mnt, name,
-              lmi->lmi_mnt ? mnt_get_count(lmi->lmi_mnt) : -1);
+       CDEBUG(D_MOUNT, "dereg_mnt %p from %s\n", lmi->lmi_mnt, name);
 
         OBD_FREE(lmi->lmi_name, strlen(lmi->lmi_name) + 1);
         cfs_list_del(&lmi->lmi_list_chain);
@@ -174,9 +170,8 @@ struct lustre_mount_info *server_get_mount(const char *name)
 
         cfs_atomic_inc(&lsi->lsi_mounts);
 
-        CDEBUG(D_MOUNT, "get_mnt %p from %s, refs=%d, vfscount=%d\n",
-               lmi->lmi_mnt, name, cfs_atomic_read(&lsi->lsi_mounts),
-              lmi->lmi_mnt ? mnt_get_count(lmi->lmi_mnt) - 1 : -1);
+       CDEBUG(D_MOUNT, "get_mnt %p from %s, refs=%d\n", lmi->lmi_mnt,
+              name, cfs_atomic_read(&lsi->lsi_mounts));
 
         RETURN(lmi);
 }
@@ -209,7 +204,6 @@ int server_put_mount(const char *name, struct vfsmount *mnt)
 {
         struct lustre_mount_info *lmi;
         struct lustre_sb_info *lsi;
-       int count = 0;
         ENTRY;
 
         cfs_mutex_lock(&lustre_mount_info_lock);
@@ -221,16 +215,12 @@ int server_put_mount(const char *name, struct vfsmount *mnt)
         }
         lsi = s2lsi(lmi->lmi_sb);
 
-        CDEBUG(D_MOUNT, "put_mnt %p from %s, refs=%d, vfscount=%d\n",
-               lmi->lmi_mnt, name, cfs_atomic_read(&lsi->lsi_mounts), count);
+       CDEBUG(D_MOUNT, "put_mnt %p from %s, refs=%d\n",
+              lmi->lmi_mnt, name, cfs_atomic_read(&lsi->lsi_mounts));
 
-        if (lustre_put_lsi(lmi->lmi_sb)) {
-                CDEBUG(D_MOUNT, "Last put of mnt %p from %s, vfscount=%d\n",
-                       lmi->lmi_mnt, name, count);
-                /* last mount is the One True Mount */
-                if (count > 1)
-                        CERROR("%s: mount busy, vfscount=%d!\n", name, count);
-        }
+       if (lustre_put_lsi(lmi->lmi_sb))
+               CDEBUG(D_MOUNT, "Last put of mnt %p from %s\n",
+                      lmi->lmi_mnt, name);
 
         /* this obd should never need the mount again */
         server_deregister_mount(name);