From be595d154d9a3ff452051083f27efbb34668e461 Mon Sep 17 00:00:00 2001 From: Dave Kleikamp Date: Mon, 24 Nov 2003 21:41:19 -0800 Subject: [PATCH] [PATCH] JFS: Avoid segfault when dirty inodes are written on readonly mount This fixes an oops that can occur if JFS is used as the root filesystem. Writes to a device node may cause a ->write_inode to be called during a read-only mount. JFS needs to check for NULL log in jfs_flush_journal. --- fs/jfs/jfs_logmgr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 553c2d535e821..828c237d5bf18 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1415,6 +1415,10 @@ void jfs_flush_journal(struct jfs_log *log, int wait) int i; struct tblock *target; + /* jfs_write_inode may call us during read-only mount */ + if (!log) + return; + jfs_info("jfs_flush_journal: log:0x%p wait=%d", log, wait); LOGGC_LOCK(log); -- 2.53.0