Patch "FS: JFS: Check for read-only mounted filesystem in txBegin" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    FS: JFS: Check for read-only mounted filesystem in txBegin

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     fs-jfs-check-for-read-only-mounted-filesystem-in-txb.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cddaca687560e7e20b9c946387b099d8adf0f620
Author: Immad Mir <mirimmad17@xxxxxxxxx>
Date:   Fri Jun 23 19:17:08 2023 +0530

    FS: JFS: Check for read-only mounted filesystem in txBegin
    
    [ Upstream commit 95e2b352c03b0a86c5717ba1d24ea20969abcacc ]
    
     This patch adds a check for read-only mounted filesystem
     in txBegin before starting a transaction potentially saving
     from NULL pointer deref.
    
    Signed-off-by: Immad Mir <mirimmad17@xxxxxxxxx>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 224ef034004b7..2cb460912468e 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -367,6 +367,11 @@ tid_t txBegin(struct super_block *sb, int flag)
 	jfs_info("txBegin: flag = 0x%x", flag);
 	log = JFS_SBI(sb)->log;
 
+	if (!log) {
+		jfs_error(sb, "read-only filesystem\n");
+		return 0;
+	}
+
 	TXN_LOCK();
 
 	INCREMENT(TxStat.txBegin);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux