diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-06-29 13:10:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-06-29 13:10:32 -0700 |
commit | b9d02c224d00a412d9c7fb1f92c358604038a783 (patch) | |
tree | c6afab13c23ff126aeddc3e1c9bac681b3827580 /fs/jfs/namei.c | |
parent | be3c213150dc4370ef211a78d78457ff166eba4e (diff) | |
parent | 95e2b352c03b0a86c5717ba1d24ea20969abcacc (diff) |
Merge tag 'jfs-6.5' of github.com:kleikamp/linux-shaggy
Pull jfs updates from David Kleikamp:
"Minor bug fixes and cleanups"
* tag 'jfs-6.5' of github.com:kleikamp/linux-shaggy:
FS: JFS: Check for read-only mounted filesystem in txBegin
FS: JFS: Fix null-ptr-deref Read in txBegin
fs: jfs: Fix UBSAN: array-index-out-of-bounds in dbAllocDmapLev
fs: jfs: (trivial) Fix typo in dbInitTree function
jfs: jfs_dmap: Validate db_l2nbperpage while mounting
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r-- | fs/jfs/namei.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 494b9f4043cf..9b030297aa64 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c @@ -799,6 +799,11 @@ static int jfs_link(struct dentry *old_dentry, if (rc) goto out; + if (isReadOnly(ip)) { + jfs_error(ip->i_sb, "read-only filesystem\n"); + return -EROFS; + } + tid = txBegin(ip->i_sb, 0); mutex_lock_nested(&JFS_IP(dir)->commit_mutex, COMMIT_MUTEX_PARENT); |