summaryrefslogtreecommitdiff
path: root/fs/jfs/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-06-29 13:10:32 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-06-29 13:10:32 -0700
commitb9d02c224d00a412d9c7fb1f92c358604038a783 (patch)
treec6afab13c23ff126aeddc3e1c9bac681b3827580 /fs/jfs/namei.c
parentbe3c213150dc4370ef211a78d78457ff166eba4e (diff)
parent95e2b352c03b0a86c5717ba1d24ea20969abcacc (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.c5
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);