]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] JFS: Avoid segfault when dirty inodes are written on readonly mount
authorDave Kleikamp <shaggy@austin.ibm.com>
Tue, 25 Nov 2003 05:41:19 +0000 (21:41 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 25 Nov 2003 05:41:19 +0000 (21:41 -0800)
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

index 553c2d535e821ccef7b86c783784b4fd8ca73062..828c237d5bf1876c4d0df2e23c860e00261064d1 100644 (file)
@@ -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);