Whamcloud - gitweb
Branch b1_5
authornathan <nathan>
Thu, 6 Jul 2006 23:32:24 +0000 (23:32 +0000)
committernathan <nathan>
Thu, 6 Jul 2006 23:32:24 +0000 (23:32 +0000)
b=10010
clear readonly only on dropping last mount

lustre/mds/handler.c
lustre/mgs/mgs_handler.c
lustre/obdclass/obd_mount.c
lustre/obdfilter/filter.c

index 1dde475..30fe245 100644 (file)
@@ -2206,9 +2206,11 @@ static int mds_cleanup(struct obd_device *obd)
                 must_relock++;
         }
         
-        if (must_put) 
+        if (must_put) {
                 /* In case we didn't mount with lustre_get_mount -- old method*/
                 mntput(mds->mds_vfsmnt);
+                lvfs_clear_rdonly(save_dev);
+        }
         obd->u.obt.obt_sb = NULL;
 
         ldlm_namespace_free(obd->obd_namespace, obd->obd_force);
@@ -2220,8 +2222,6 @@ static int mds_cleanup(struct obd_device *obd)
         }
         spin_unlock_bh(&obd->obd_processing_task_lock);
 
-        lvfs_clear_rdonly(save_dev);
-
         if (must_relock)
                 lock_kernel();
 
index 5f0c11a..2493fa0 100644 (file)
@@ -251,7 +251,6 @@ static int mgs_ldlm_nsfree(void *data)
 static int mgs_cleanup(struct obd_device *obd)
 {
         struct mgs_obd *mgs = &obd->u.mgs;
-        lvfs_sbdev_type save_dev;
         ENTRY;
 
         ping_evictor_stop();
@@ -259,7 +258,6 @@ static int mgs_cleanup(struct obd_device *obd)
         if (mgs->mgs_sb == NULL)
                 RETURN(0);
 
-        save_dev = lvfs_sbdev(mgs->mgs_sb);
         
         ptlrpc_unregister_service(mgs->mgs_service);
 
@@ -278,7 +276,6 @@ static int mgs_cleanup(struct obd_device *obd)
         cfs_kernel_thread(mgs_ldlm_nsfree, obd->obd_namespace, 
                           CLONE_VM | CLONE_FILES);
 
-        lvfs_clear_rdonly(save_dev);
 
         fsfilt_put_ops(obd->obd_fsops);
 
index 7fb5999..0cb1efc 100644 (file)
@@ -1281,6 +1281,7 @@ static void server_put_super(struct super_block *sb)
         struct lustre_sb_info *lsi = s2lsi(sb);
         struct obd_device     *obd;
         struct vfsmount       *mnt = lsi->lsi_srv_mnt;
+        lvfs_sbdev_type        save_dev;
         char *tmpname;
         int tmpname_sz;
         int lddflags = lsi->lsi_ldd->ldd_flags;
@@ -1327,6 +1328,8 @@ static void server_put_super(struct super_block *sb)
                 server_stop_mgs(sb);
         }
 
+        save_dev = lvfs_sbdev(sb);
+
         /* Clean the mgc and sb */
         rc = lustre_common_put_super(sb);
         /* FIXME how can I report a failure to umount? */ 
@@ -1337,6 +1340,7 @@ static void server_put_super(struct super_block *sb)
         
         /* drop the One True Mount */
         unlock_mntput(mnt);
+        lvfs_clear_rdonly(save_dev);
         
         /* Stop the servers (MDS, OSS) if no longer needed.  We must wait
            until the target is really gone so that our type refcount check
index beb559c..91a02b9 100644 (file)
@@ -1892,13 +1892,13 @@ static int filter_cleanup(struct obd_device *obd)
                 must_relock++;
         }
         
-        if (must_put) 
+        if (must_put) {
                 /* In case we didn't mount with lustre_get_mount -- old method*/
                 mntput(filter->fo_vfsmnt);
+                lvfs_clear_rdonly(save_dev);
+        }
         obd->u.obt.obt_sb = NULL;
 
-        lvfs_clear_rdonly(save_dev);
-
         if (must_relock)
                 lock_kernel();