From: nathan Date: Thu, 6 Jul 2006 23:32:24 +0000 (+0000) Subject: Branch b1_5 X-Git-Tag: v1_7_100~1^90~8^2~24 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9fbfb7a2e73cb2226deb2d6bcb556a406e3fbcbc;p=fs%2Flustre-release.git Branch b1_5 b=10010 clear readonly only on dropping last mount --- diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 1dde475..30fe245 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -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(); diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 5f0c11a..2493fa0 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -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); diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 7fb5999..0cb1efc 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -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 diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index beb559c4..91a02b9 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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();