Skip to content

Commit 7141433

Browse files
committed
Merge tag 'gfs2-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull gfs2 updates from Andreas Gruenbacher: - Prevent rename() from failing with -ESTALE when there are locking conflicts and retry the operation instead - Don't fail when fiemap triggers a page fault (xfstest generic/742) - Fix another locking request cancellation bug - Minor other fixes and cleanups * tag 'gfs2-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: fiemap page fault fix gfs2: fix memory leaks in gfs2_fill_super error path gfs2: Fix use-after-free in iomap inline data write path gfs2: Fix slab-use-after-free in qd_put gfs2: Introduce glock_{type,number,sbd} helpers gfs2: gfs2_glock_hold cleanup gfs: Use fixed GL_GLOCK_MIN_HOLD time gfs2: Fix gfs2_log_get_bio argument type gfs2: gfs2_chain_bio start sector fix gfs2: Initialize bio->bi_opf early gfs2: Rename gfs2_log_submit_{bio -> write} gfs2: Do not cancel internal demote requests gfs2: run_queue cleanup gfs2: Retries missing in gfs2_{rename,exchange} gfs2: glock cancelation flag fix
2 parents 56feb53 + e411d74 commit 7141433

18 files changed

Lines changed: 277 additions & 186 deletions

fs/gfs2/bmap.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,10 +1127,18 @@ static int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length,
11271127
goto out_unlock;
11281128
break;
11291129
default:
1130-
goto out_unlock;
1130+
goto out;
11311131
}
11321132

11331133
ret = gfs2_iomap_begin_write(inode, pos, length, flags, iomap, &mp);
1134+
if (ret)
1135+
goto out_unlock;
1136+
1137+
out:
1138+
if (iomap->type == IOMAP_INLINE) {
1139+
iomap->private = metapath_dibh(&mp);
1140+
get_bh(iomap->private);
1141+
}
11341142

11351143
out_unlock:
11361144
release_metapath(&mp);
@@ -1144,6 +1152,9 @@ static int gfs2_iomap_end(struct inode *inode, loff_t pos, loff_t length,
11441152
struct gfs2_inode *ip = GFS2_I(inode);
11451153
struct gfs2_sbd *sdp = GFS2_SB(inode);
11461154

1155+
if (iomap->private)
1156+
brelse(iomap->private);
1157+
11471158
switch (flags & (IOMAP_WRITE | IOMAP_ZERO)) {
11481159
case IOMAP_WRITE:
11491160
if (flags & IOMAP_DIRECT)

0 commit comments

Comments
 (0)