Skip to content

Commit f76d94d

Browse files
committed
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
2 parents 3aa2050 + 2645695 commit f76d94d

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

fs/jfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static int jfs_open(struct inode *inode, struct file *file)
7676
if (ji->active_ag == -1) {
7777
struct jfs_sb_info *jfs_sb = JFS_SBI(inode->i_sb);
7878
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]);
8080
}
8181
spin_unlock_irq(&ji->ag_lock);
8282
}

fs/jfs/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ int jfs_write_inode(struct inode *inode, struct writeback_control *wbc)
134134
* It has been committed since the last change, but was still
135135
* on the dirty inode list.
136136
*/
137-
if (!test_cflag(COMMIT_Dirty, inode)) {
137+
if (!test_cflag(COMMIT_Dirty, inode)) {
138138
/* Make sure committed changes hit the disk */
139139
jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait);
140140
return 0;
141-
}
141+
}
142142

143143
if (jfs_commit_inode(inode, wait)) {
144144
jfs_err("jfs_write_inode: jfs_commit_inode failed!");

fs/jfs/namei.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
11601160
rc = dtModify(tid, new_dir, &new_dname, &ino,
11611161
old_ip->i_ino, JFS_RENAME);
11621162
if (rc)
1163-
goto out4;
1163+
goto out_tx;
11641164
drop_nlink(new_ip);
11651165
if (S_ISDIR(new_ip->i_mode)) {
11661166
drop_nlink(new_ip);
@@ -1185,7 +1185,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
11851185
if ((new_size = commitZeroLink(tid, new_ip)) < 0) {
11861186
txAbort(tid, 1); /* Marks FS Dirty */
11871187
rc = new_size;
1188-
goto out4;
1188+
goto out_tx;
11891189
}
11901190
tblk = tid_to_tblock(tid);
11911191
tblk->xflag |= COMMIT_DELETE;
@@ -1203,15 +1203,15 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
12031203
if (rc) {
12041204
jfs_err("jfs_rename didn't expect dtSearch to fail "
12051205
"w/rc = %d", rc);
1206-
goto out4;
1206+
goto out_tx;
12071207
}
12081208

12091209
ino = old_ip->i_ino;
12101210
rc = dtInsert(tid, new_dir, &new_dname, &ino, &btstack);
12111211
if (rc) {
12121212
if (rc == -EIO)
12131213
jfs_err("jfs_rename: dtInsert returned -EIO");
1214-
goto out4;
1214+
goto out_tx;
12151215
}
12161216
if (S_ISDIR(old_ip->i_mode))
12171217
inc_nlink(new_dir);
@@ -1226,7 +1226,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
12261226
jfs_err("jfs_rename did not expect dtDelete to return rc = %d",
12271227
rc);
12281228
txAbort(tid, 1); /* Marks Filesystem dirty */
1229-
goto out4;
1229+
goto out_tx;
12301230
}
12311231
if (S_ISDIR(old_ip->i_mode)) {
12321232
drop_nlink(old_dir);
@@ -1285,7 +1285,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
12851285

12861286
rc = txCommit(tid, ipcount, iplist, commit_flag);
12871287

1288-
out4:
1288+
out_tx:
12891289
txEnd(tid);
12901290
if (new_ip)
12911291
mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
@@ -1308,13 +1308,6 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
13081308
}
13091309
if (new_ip && (new_ip->i_nlink == 0))
13101310
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);
13181311
/*
13191312
* Truncating the directory index table is not guaranteed. It
13201313
* may need to be done iteratively
@@ -1325,7 +1318,13 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
13251318

13261319
clear_cflag(COMMIT_Stale, old_dir);
13271320
}
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:
13291328
jfs_info("jfs_rename: returning %d", rc);
13301329
return rc;
13311330
}

0 commit comments

Comments
 (0)