From: Alex Zhuravlev Date: Thu, 13 Sep 2012 16:24:20 +0000 (+0400) Subject: LU-1919 mount: do not access vfs mnt directly X-Git-Tag: 2.3.51~95 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3a89bc3fabc384930fe03d1ef811a2ea57dc068a LU-1919 mount: do not access vfs mnt directly 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 Change-Id: I91bae528bc229cd4e0e191e61eae8a7854494c8f Reviewed-on: http://review.whamcloud.com/3982 Reviewed-by: Oleg Drokin Tested-by: Hudson Tested-by: Maloo --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index b2ec636..b193034 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -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);