mirror of
https://gitee.com/bianbu-linux/linux-6.6-fh
synced 2025-04-24 22:37:49 -04:00
FS: JFS: Check for read-only mounted filesystem in txBegin
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@gmail.com> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
This commit is contained in:
parent
47cfdc338d
commit
95e2b352c0
1 changed files with 5 additions and 0 deletions
|
@ -354,6 +354,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue