summaryrefslogtreecommitdiff
path: root/fs/jfs/jfs_umount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/jfs_umount.c')
-rw-r--r--fs/jfs/jfs_umount.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/jfs/jfs_umount.c b/fs/jfs/jfs_umount.c
index 8ec43f53f686..18569f1eaabd 100644
--- a/fs/jfs/jfs_umount.c
+++ b/fs/jfs/jfs_umount.c
@@ -20,6 +20,7 @@
#include "jfs_superblock.h"
#include "jfs_dmap.h"
#include "jfs_imap.h"
+#include "jfs_logmgr.h"
#include "jfs_metapage.h"
#include "jfs_debug.h"
@@ -58,6 +59,12 @@ int jfs_umount(struct super_block *sb)
jfs_flush_journal(log, 2);
/*
+ * Hold log lock so write_special_inodes (lmLogSync) cannot see
+ * this sbi with a NULL inode pointer while iterating log->sb_list.
+ */
+ if (log)
+ LOG_LOCK(log);
+ /*
* close fileset inode allocation map (aka fileset inode)
*/
diUnmount(ipimap, 0);
@@ -95,6 +102,9 @@ int jfs_umount(struct super_block *sb)
*/
filemap_write_and_wait(sbi->direct_inode->i_mapping);
+ if (log)
+ LOG_UNLOCK(log);
+
/*
* ensure all file system file pages are propagated to their
* home blocks on disk (and their in-memory buffer pages are