Merge tag 'jfs-4.2' of git://github.com/kleikamp/linux-shaggy
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Jul 2015 23:28:28 +0000 (16:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Jul 2015 23:28:28 +0000 (16:28 -0700)
Pull jfs fixes from David Kleikamp:
 "A couple trivial fixes and an error path fix"

* tag 'jfs-4.2' of git://github.com/kleikamp/linux-shaggy:
  jfs: clean up jfs_rename and fix out of order unlock
  jfs: fix indentation on if statement
  jfs: removed a prohibited space after opening parenthesis

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

diff --combined fs/jfs/inode.c
@@@ -63,12 -63,11 +63,12 @@@ struct inode *jfs_iget(struct super_blo
                        inode->i_mapping->a_ops = &jfs_aops;
                } else {
                        inode->i_op = &jfs_fast_symlink_inode_operations;
 +                      inode->i_link = JFS_IP(inode)->i_inline;
                        /*
                         * The inline data should be null-terminated, but
                         * don't let on-disk corruption crash the kernel
                         */
 -                      JFS_IP(inode)->i_inline[inode->i_size] = '\0';
 +                      inode->i_link[inode->i_size] = '\0';
                }
        } else {
                inode->i_op = &jfs_file_inode_operations;
@@@ -134,11 -133,11 +134,11 @@@ int jfs_write_inode(struct inode *inode
         * It has been committed since the last change, but was still
         * on the dirty inode list.
         */
-        if (!test_cflag(COMMIT_Dirty, inode)) {
+       if (!test_cflag(COMMIT_Dirty, inode)) {
                /* Make sure committed changes hit the disk */
                jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait);
                return 0;
-        }
+       }
  
        if (jfs_commit_inode(inode, wait)) {
                jfs_err("jfs_write_inode: jfs_commit_inode failed!");
diff --combined fs/jfs/namei.c
@@@ -880,6 -880,7 +880,6 @@@ static int jfs_symlink(struct inode *di
        int ssize;              /* source pathname size */
        struct btstack btstack;
        struct inode *ip = d_inode(dentry);
 -      unchar *i_fastsymlink;
        s64 xlen = 0;
        int bmask = 0, xsize;
        s64 xaddr;
        if (ssize <= IDATASIZE) {
                ip->i_op = &jfs_fast_symlink_inode_operations;
  
 -              i_fastsymlink = JFS_IP(ip)->i_inline;
 -              memcpy(i_fastsymlink, name, ssize);
 +              ip->i_link = JFS_IP(ip)->i_inline;
 +              memcpy(ip->i_link, name, ssize);
                ip->i_size = ssize - 1;
  
                /*
@@@ -1160,7 -1161,7 +1160,7 @@@ static int jfs_rename(struct inode *old
                rc = dtModify(tid, new_dir, &new_dname, &ino,
                              old_ip->i_ino, JFS_RENAME);
                if (rc)
-                       goto out4;
+                       goto out_tx;
                drop_nlink(new_ip);
                if (S_ISDIR(new_ip->i_mode)) {
                        drop_nlink(new_ip);
                        if ((new_size = commitZeroLink(tid, new_ip)) < 0) {
                                txAbort(tid, 1);        /* Marks FS Dirty */
                                rc = new_size;
-                               goto out4;
+                               goto out_tx;
                        }
                        tblk = tid_to_tblock(tid);
                        tblk->xflag |= COMMIT_DELETE;
                if (rc) {
                        jfs_err("jfs_rename didn't expect dtSearch to fail "
                                "w/rc = %d", rc);
-                       goto out4;
+                       goto out_tx;
                }
  
                ino = old_ip->i_ino;
                if (rc) {
                        if (rc == -EIO)
                                jfs_err("jfs_rename: dtInsert returned -EIO");
-                       goto out4;
+                       goto out_tx;
                }
                if (S_ISDIR(old_ip->i_mode))
                        inc_nlink(new_dir);
                jfs_err("jfs_rename did not expect dtDelete to return rc = %d",
                        rc);
                txAbort(tid, 1);        /* Marks Filesystem dirty */
-               goto out4;
+               goto out_tx;
        }
        if (S_ISDIR(old_ip->i_mode)) {
                drop_nlink(old_dir);
  
        rc = txCommit(tid, ipcount, iplist, commit_flag);
  
-       out4:
+       out_tx:
        txEnd(tid);
        if (new_ip)
                mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
        }
        if (new_ip && (new_ip->i_nlink == 0))
                set_cflag(COMMIT_Nolink, new_ip);
-       out3:
-       free_UCSname(&new_dname);
-       out2:
-       free_UCSname(&old_dname);
-       out1:
-       if (new_ip && !S_ISDIR(new_ip->i_mode))
-               IWRITE_UNLOCK(new_ip);
        /*
         * Truncating the directory index table is not guaranteed.  It
         * may need to be done iteratively
  
                clear_cflag(COMMIT_Stale, old_dir);
        }
+       if (new_ip && !S_ISDIR(new_ip->i_mode))
+               IWRITE_UNLOCK(new_ip);
+       out3:
+       free_UCSname(&new_dname);
+       out2:
+       free_UCSname(&old_dname);
+       out1:
        jfs_info("jfs_rename: returning %d", rc);
        return rc;
  }