aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/ops_fstype.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index a6225cce2cbc..ae35f097aa6a 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1237,14 +1237,17 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
1237static void gfs2_kill_sb(struct super_block *sb) 1237static void gfs2_kill_sb(struct super_block *sb)
1238{ 1238{
1239 struct gfs2_sbd *sdp = sb->s_fs_info; 1239 struct gfs2_sbd *sdp = sb->s_fs_info;
1240 gfs2_meta_syncfs(sdp); 1240 if (sdp) {
1241 dput(sdp->sd_root_dir); 1241 gfs2_meta_syncfs(sdp);
1242 dput(sdp->sd_master_dir); 1242 dput(sdp->sd_root_dir);
1243 sdp->sd_root_dir = NULL; 1243 dput(sdp->sd_master_dir);
1244 sdp->sd_master_dir = NULL; 1244 sdp->sd_root_dir = NULL;
1245 sdp->sd_master_dir = NULL;
1246 }
1245 shrink_dcache_sb(sb); 1247 shrink_dcache_sb(sb);
1246 kill_block_super(sb); 1248 kill_block_super(sb);
1247 gfs2_delete_debugfs_file(sdp); 1249 if (sdp)
1250 gfs2_delete_debugfs_file(sdp);
1248} 1251}
1249 1252
1250struct file_system_type gfs2_fs_type = { 1253struct file_system_type gfs2_fs_type = {