aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-16 19:28:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-16 19:28:28 -0400
commitf76d94def5605fbec1de61218e91fe1002fd322f (patch)
tree8181de42c62a8a30453bc6c70326a4ff278af726
parent3aa20508a6fe386c2a893027ef4c4ef78ee4eac2 (diff)
parent26456955719b79cc4a011b18221aa68f599f6b6c (diff)
Merge tag 'jfs-4.2' of git://github.com/kleikamp/linux-shaggy
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
-rw-r--r--fs/jfs/file.c2
-rw-r--r--fs/jfs/inode.c4
-rw-r--r--fs/jfs/namei.c27
3 files changed, 16 insertions, 17 deletions
diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index e98d39d75cf4..b9dc23cd04f2 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
@@ -76,7 +76,7 @@ static int jfs_open(struct inode *inode, struct file *file)
76 if (ji->active_ag == -1) { 76 if (ji->active_ag == -1) {
77 struct jfs_sb_info *jfs_sb = JFS_SBI(inode->i_sb); 77 struct jfs_sb_info *jfs_sb = JFS_SBI(inode->i_sb);
78 ji->active_ag = BLKTOAG(addressPXD(&ji->ixpxd), jfs_sb); 78 ji->active_ag = BLKTOAG(addressPXD(&ji->ixpxd), jfs_sb);
79 atomic_inc( &jfs_sb->bmap->db_active[ji->active_ag]); 79 atomic_inc(&jfs_sb->bmap->db_active[ji->active_ag]);
80 } 80 }
81 spin_unlock_irq(&ji->ag_lock); 81 spin_unlock_irq(&ji->ag_lock);
82 } 82 }
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 6f1cb2b5ee28..41aa3ca6a6a4 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
@@ -134,11 +134,11 @@ int jfs_write_inode(struct inode *inode, struct writeback_control *wbc)
134 * It has been committed since the last change, but was still 134 * It has been committed since the last change, but was still
135 * on the dirty inode list. 135 * on the dirty inode list.
136 */ 136 */
137 if (!test_cflag(COMMIT_Dirty, inode)) { 137 if (!test_cflag(COMMIT_Dirty, inode)) {
138 /* Make sure committed changes hit the disk */ 138 /* Make sure committed changes hit the disk */
139 jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait); 139 jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait);
140 return 0; 140 return 0;
141 } 141 }
142 142
143 if (jfs_commit_inode(inode, wait)) { 143 if (jfs_commit_inode(inode, wait)) {
144 jfs_err("jfs_write_inode: jfs_commit_inode failed!"); 144 jfs_err("jfs_write_inode: jfs_commit_inode failed!");
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index e33be921aa41..a5ac97b9a933 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1160,7 +1160,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1160 rc = dtModify(tid, new_dir, &new_dname, &ino, 1160 rc = dtModify(tid, new_dir, &new_dname, &ino,
1161 old_ip->i_ino, JFS_RENAME); 1161 old_ip->i_ino, JFS_RENAME);
1162 if (rc) 1162 if (rc)
1163 goto out4; 1163 goto out_tx;
1164 drop_nlink(new_ip); 1164 drop_nlink(new_ip);
1165 if (S_ISDIR(new_ip->i_mode)) { 1165 if (S_ISDIR(new_ip->i_mode)) {
1166 drop_nlink(new_ip); 1166 drop_nlink(new_ip);
@@ -1185,7 +1185,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1185 if ((new_size = commitZeroLink(tid, new_ip)) < 0) { 1185 if ((new_size = commitZeroLink(tid, new_ip)) < 0) {
1186 txAbort(tid, 1); /* Marks FS Dirty */ 1186 txAbort(tid, 1); /* Marks FS Dirty */
1187 rc = new_size; 1187 rc = new_size;
1188 goto out4; 1188 goto out_tx;
1189 } 1189 }
1190 tblk = tid_to_tblock(tid); 1190 tblk = tid_to_tblock(tid);
1191 tblk->xflag |= COMMIT_DELETE; 1191 tblk->xflag |= COMMIT_DELETE;
@@ -1203,7 +1203,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1203 if (rc) { 1203 if (rc) {
1204 jfs_err("jfs_rename didn't expect dtSearch to fail " 1204 jfs_err("jfs_rename didn't expect dtSearch to fail "
1205 "w/rc = %d", rc); 1205 "w/rc = %d", rc);
1206 goto out4; 1206 goto out_tx;
1207 } 1207 }
1208 1208
1209 ino = old_ip->i_ino; 1209 ino = old_ip->i_ino;
@@ -1211,7 +1211,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1211 if (rc) { 1211 if (rc) {
1212 if (rc == -EIO) 1212 if (rc == -EIO)
1213 jfs_err("jfs_rename: dtInsert returned -EIO"); 1213 jfs_err("jfs_rename: dtInsert returned -EIO");
1214 goto out4; 1214 goto out_tx;
1215 } 1215 }
1216 if (S_ISDIR(old_ip->i_mode)) 1216 if (S_ISDIR(old_ip->i_mode))
1217 inc_nlink(new_dir); 1217 inc_nlink(new_dir);
@@ -1226,7 +1226,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1226 jfs_err("jfs_rename did not expect dtDelete to return rc = %d", 1226 jfs_err("jfs_rename did not expect dtDelete to return rc = %d",
1227 rc); 1227 rc);
1228 txAbort(tid, 1); /* Marks Filesystem dirty */ 1228 txAbort(tid, 1); /* Marks Filesystem dirty */
1229 goto out4; 1229 goto out_tx;
1230 } 1230 }
1231 if (S_ISDIR(old_ip->i_mode)) { 1231 if (S_ISDIR(old_ip->i_mode)) {
1232 drop_nlink(old_dir); 1232 drop_nlink(old_dir);
@@ -1285,7 +1285,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1285 1285
1286 rc = txCommit(tid, ipcount, iplist, commit_flag); 1286 rc = txCommit(tid, ipcount, iplist, commit_flag);
1287 1287
1288 out4: 1288 out_tx:
1289 txEnd(tid); 1289 txEnd(tid);
1290 if (new_ip) 1290 if (new_ip)
1291 mutex_unlock(&JFS_IP(new_ip)->commit_mutex); 1291 mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
@@ -1308,13 +1308,6 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1308 } 1308 }
1309 if (new_ip && (new_ip->i_nlink == 0)) 1309 if (new_ip && (new_ip->i_nlink == 0))
1310 set_cflag(COMMIT_Nolink, new_ip); 1310 set_cflag(COMMIT_Nolink, new_ip);
1311 out3:
1312 free_UCSname(&new_dname);
1313 out2:
1314 free_UCSname(&old_dname);
1315 out1:
1316 if (new_ip && !S_ISDIR(new_ip->i_mode))
1317 IWRITE_UNLOCK(new_ip);
1318 /* 1311 /*
1319 * Truncating the directory index table is not guaranteed. It 1312 * Truncating the directory index table is not guaranteed. It
1320 * may need to be done iteratively 1313 * may need to be done iteratively
@@ -1325,7 +1318,13 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1325 1318
1326 clear_cflag(COMMIT_Stale, old_dir); 1319 clear_cflag(COMMIT_Stale, old_dir);
1327 } 1320 }
1328 1321 if (new_ip && !S_ISDIR(new_ip->i_mode))
1322 IWRITE_UNLOCK(new_ip);
1323 out3:
1324 free_UCSname(&new_dname);
1325 out2:
1326 free_UCSname(&old_dname);
1327 out1:
1329 jfs_info("jfs_rename: returning %d", rc); 1328 jfs_info("jfs_rename: returning %d", rc);
1330 return rc; 1329 return rc;
1331} 1330}