Merge tag 'jfs-7.0' of github.com:kleikamp/linux-shaggy

Pull jfs updates from Dave Kleikamp:
 "Just a handful of minor jfs fixes"

* tag 'jfs-7.0' of github.com:kleikamp/linux-shaggy:
  jfs: avoid -Wtautological-constant-out-of-range-compare warning
  jfs: Add missing set_freezable() for freezable kthread
  jfs: nlink overflow in jfs_rename
This commit is contained in:
Linus Torvalds
2026-02-12 09:30:56 -08:00
3 changed files with 7 additions and 4 deletions

View File

@@ -2903,7 +2903,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
stbl = DT_GETSTBL(p);
for (i = index; i < p->header.nextindex; i++) {
if (stbl[i] < 0 || stbl[i] >= DTPAGEMAXSLOT) {
if (stbl[i] < 0) {
jfs_err("JFS: Invalid stbl[%d] = %d for inode %ld, block = %lld",
i, stbl[i], (long)ip->i_ino, (long long)bn);
free_page(dirent_buf);
@@ -3108,7 +3108,7 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack)
/* get the leftmost entry */
stbl = DT_GETSTBL(p);
if (stbl[0] < 0 || stbl[0] >= DTPAGEMAXSLOT) {
if (stbl[0] < 0) {
DT_PUTPAGE(mp);
jfs_error(ip->i_sb, "stbl[0] out of bound\n");
return -EIO;

View File

@@ -2311,6 +2311,7 @@ int jfsIOWait(void *arg)
{
struct lbuf *bp;
set_freezable();
do {
spin_lock_irq(&log_redrive_lock);
while ((bp = log_redrive_list)) {

View File

@@ -1229,7 +1229,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
jfs_err("jfs_rename: dtInsert returned -EIO");
goto out_tx;
}
if (S_ISDIR(old_ip->i_mode))
if (S_ISDIR(old_ip->i_mode) && old_dir != new_dir)
inc_nlink(new_dir);
}
/*
@@ -1245,7 +1245,9 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
goto out_tx;
}
if (S_ISDIR(old_ip->i_mode)) {
drop_nlink(old_dir);
if (new_ip || old_dir != new_dir)
drop_nlink(old_dir);
if (old_dir != new_dir) {
/*
* Change inode number of parent for moved directory