mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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@gmail.com> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a7225e9e09
commit
a88efca805
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user