Commit 20ca21df authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull gfs2 fixes from Andreas Gruenbacher:
 "Fix jdata data corruption and glock reference leak"

* tag 'gfs2-v5.10-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: Fix case in which ail writes are done to jdata holes
  Revert "gfs2: Ignore journal log writes for jdata holes"
  gfs2: fix possible reference leak in gfs2_check_blk_type
parents db7c9535 4e79e3f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static int gfs2_get_block_noalloc(struct inode *inode, sector_t lblock,
	if (error)
		return error;
	if (!buffer_mapped(bh_result))
		return -EIO;
		return -ENODATA;
	return 0;
}

+2 −6
Original line number Diff line number Diff line
@@ -1301,12 +1301,8 @@ int gfs2_block_map(struct inode *inode, sector_t lblock,
	trace_gfs2_bmap(ip, bh_map, lblock, create, 1);

	ret = gfs2_iomap_get(inode, pos, length, flags, &iomap, &mp);
	if (!ret && iomap.type == IOMAP_HOLE) {
		if (create)
	if (create && !ret && iomap.type == IOMAP_HOLE)
		ret = gfs2_iomap_alloc(inode, &iomap, &mp);
		else
			ret = -ENODATA;
	}
	release_metapath(&mp);
	if (ret)
		goto out;
+2 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ __acquires(&sdp->sd_ail_lock)
		spin_unlock(&sdp->sd_ail_lock);
		ret = generic_writepages(mapping, wbc);
		spin_lock(&sdp->sd_ail_lock);
		if (ret == -ENODATA) /* if a jdata write into a new hole */
			ret = 0; /* ignore it */
		if (ret || wbc->nr_to_write <= 0)
			break;
		return -EBUSY;
+5 −5
Original line number Diff line number Diff line
@@ -2529,13 +2529,13 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)

	rbm.rgd = rgd;
	error = gfs2_rbm_from_block(&rbm, no_addr);
	if (WARN_ON_ONCE(error))
		goto fail;

	if (!WARN_ON_ONCE(error)) {
		if (gfs2_testbit(&rbm, false) != type)
			error = -ESTALE;
	}

	gfs2_glock_dq_uninit(&rgd_gh);

fail:
	return error;
}