]> Git Repo - linux.git/commitdiff
Merge tag 'jfs-6.6' of github.com:kleikamp/linux-shaggy
authorLinus Torvalds <[email protected]>
Thu, 31 Aug 2023 22:25:01 +0000 (15:25 -0700)
committerLinus Torvalds <[email protected]>
Thu, 31 Aug 2023 22:25:01 +0000 (15:25 -0700)
Pull jfs updates from Dave Kleikamp:
 "A few small fixes"

* tag 'jfs-6.6' of github.com:kleikamp/linux-shaggy:
  jfs: validate max amount of blocks before allocation.
  jfs: remove redundant initialization to pointer ip
  jfs: fix invalid free of JFS_IP(ipimap)->i_imap in diUnmount
  FS: JFS: (trivial) Fix grammatical error in extAlloc
  fs/jfs: prevent double-free in dbUnmount() after failed jfs_remount()

1  2 
fs/jfs/jfs_imap.c
fs/jfs/namei.c

diff --combined fs/jfs/jfs_imap.c
index a40383aa6c84be39d353fa518b3d212908439622,6fb28572cb2c64f6a27a8e3404d06256c5ac941b..923a58422c4611ccf1b90d2700d7423debec31cf
@@@ -193,6 -193,7 +193,7 @@@ int diUnmount(struct inode *ipimap, in
         * free in-memory control structure
         */
        kfree(imap);
+       JFS_IP(ipimap)->i_imap = NULL;
  
        return (0);
  }
@@@ -3064,8 -3065,8 +3065,8 @@@ static int copy_from_dinode(struct dino
        ip->i_atime.tv_nsec = le32_to_cpu(dip->di_atime.tv_nsec);
        ip->i_mtime.tv_sec = le32_to_cpu(dip->di_mtime.tv_sec);
        ip->i_mtime.tv_nsec = le32_to_cpu(dip->di_mtime.tv_nsec);
 -      ip->i_ctime.tv_sec = le32_to_cpu(dip->di_ctime.tv_sec);
 -      ip->i_ctime.tv_nsec = le32_to_cpu(dip->di_ctime.tv_nsec);
 +      inode_set_ctime(ip, le32_to_cpu(dip->di_ctime.tv_sec),
 +                      le32_to_cpu(dip->di_ctime.tv_nsec));
        ip->i_blocks = LBLK2PBLK(ip->i_sb, le64_to_cpu(dip->di_nblocks));
        ip->i_generation = le32_to_cpu(dip->di_gen);
  
@@@ -3139,8 -3140,8 +3140,8 @@@ static void copy_to_dinode(struct dinod
  
        dip->di_atime.tv_sec = cpu_to_le32(ip->i_atime.tv_sec);
        dip->di_atime.tv_nsec = cpu_to_le32(ip->i_atime.tv_nsec);
 -      dip->di_ctime.tv_sec = cpu_to_le32(ip->i_ctime.tv_sec);
 -      dip->di_ctime.tv_nsec = cpu_to_le32(ip->i_ctime.tv_nsec);
 +      dip->di_ctime.tv_sec = cpu_to_le32(inode_get_ctime(ip).tv_sec);
 +      dip->di_ctime.tv_nsec = cpu_to_le32(inode_get_ctime(ip).tv_nsec);
        dip->di_mtime.tv_sec = cpu_to_le32(ip->i_mtime.tv_sec);
        dip->di_mtime.tv_nsec = cpu_to_le32(ip->i_mtime.tv_nsec);
        dip->di_ixpxd = jfs_ip->ixpxd;  /* in-memory pxd's are little-endian */
diff --combined fs/jfs/namei.c
index 029d470656005b8a4e72511c2490606035a33f51,a61366146cbfe0e344706a850d50d854d9162894..57d7a4300210d2f104875640b3e2774d5589f68d
@@@ -149,7 -149,7 +149,7 @@@ static int jfs_create(struct mnt_idmap 
  
        mark_inode_dirty(ip);
  
 -      dip->i_ctime = dip->i_mtime = current_time(dip);
 +      dip->i_mtime = inode_set_ctime_current(dip);
  
        mark_inode_dirty(dip);
  
@@@ -284,7 -284,7 +284,7 @@@ static int jfs_mkdir(struct mnt_idmap *
  
        /* update parent directory inode */
        inc_nlink(dip);         /* for '..' from child directory */
 -      dip->i_ctime = dip->i_mtime = current_time(dip);
 +      dip->i_mtime = inode_set_ctime_current(dip);
        mark_inode_dirty(dip);
  
        rc = txCommit(tid, 2, &iplist[0], 0);
@@@ -390,7 -390,7 +390,7 @@@ static int jfs_rmdir(struct inode *dip
        /* update parent directory's link count corresponding
         * to ".." entry of the target directory deleted
         */
 -      dip->i_ctime = dip->i_mtime = current_time(dip);
 +      dip->i_mtime = inode_set_ctime_current(dip);
        inode_dec_link_count(dip);
  
        /*
@@@ -512,7 -512,7 +512,7 @@@ static int jfs_unlink(struct inode *dip
  
        ASSERT(ip->i_nlink);
  
 -      ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip);
 +      dip->i_mtime = inode_set_ctime_to_ts(dip, inode_set_ctime_current(ip));
        mark_inode_dirty(dip);
  
        /* update target's inode */
@@@ -827,8 -827,8 +827,8 @@@ static int jfs_link(struct dentry *old_
  
        /* update object inode */
        inc_nlink(ip);          /* for new link */
 -      ip->i_ctime = current_time(ip);
 -      dir->i_ctime = dir->i_mtime = current_time(dir);
 +      inode_set_ctime_current(ip);
 +      dir->i_mtime = inode_set_ctime_current(dir);
        mark_inode_dirty(dir);
        ihold(ip);
  
@@@ -883,7 -883,7 +883,7 @@@ static int jfs_symlink(struct mnt_idma
        struct component_name dname;
        u32 ssize;              /* source pathname size */
        struct btstack btstack;
-       struct inode *ip = d_inode(dentry);
+       struct inode *ip;
        s64 xlen = 0;
        int bmask = 0, xsize;
        s64 xaddr;
  
        mark_inode_dirty(ip);
  
 -      dip->i_ctime = dip->i_mtime = current_time(dip);
 +      dip->i_mtime = inode_set_ctime_current(dip);
        mark_inode_dirty(dip);
        /*
         * commit update of parent directory and link object
@@@ -1205,7 -1205,7 +1205,7 @@@ static int jfs_rename(struct mnt_idmap 
                        tblk->xflag |= COMMIT_DELETE;
                        tblk->u.ip = new_ip;
                } else {
 -                      new_ip->i_ctime = current_time(new_ip);
 +                      inode_set_ctime_current(new_ip);
                        mark_inode_dirty(new_ip);
                }
        } else {
        /*
         * Update ctime on changed/moved inodes & mark dirty
         */
 -      old_ip->i_ctime = current_time(old_ip);
 +      inode_set_ctime_current(old_ip);
        mark_inode_dirty(old_ip);
  
 -      new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir);
 +      new_dir->i_mtime = inode_set_ctime_current(new_dir);
        mark_inode_dirty(new_dir);
  
        /* Build list of inodes modified by this transaction */
  
        if (old_dir != new_dir) {
                iplist[ipcount++] = new_dir;
 -              old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir);
 +              old_dir->i_mtime = inode_set_ctime_current(old_dir);
                mark_inode_dirty(old_dir);
        }
  
@@@ -1416,7 -1416,7 +1416,7 @@@ static int jfs_mknod(struct mnt_idmap *
  
        mark_inode_dirty(ip);
  
 -      dir->i_ctime = dir->i_mtime = current_time(dir);
 +      dir->i_mtime = inode_set_ctime_current(dir);
  
        mark_inode_dirty(dir);
  
@@@ -1535,10 -1535,9 +1535,10 @@@ const struct inode_operations jfs_dir_i
  #endif
  };
  
 +WRAP_DIR_ITER(jfs_readdir) // FIXME!
  const struct file_operations jfs_dir_operations = {
        .read           = generic_read_dir,
 -      .iterate        = jfs_readdir,
 +      .iterate_shared = shared_jfs_readdir,
        .fsync          = jfs_fsync,
        .unlocked_ioctl = jfs_ioctl,
        .compat_ioctl   = compat_ptr_ioctl,
This page took 0.073483 seconds and 4 git commands to generate.