mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 18:10:59 -04:00
Merge tag 'gfs2-v5.10-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
ret = gfs2_iomap_alloc(inode, &iomap, &mp);
|
||||
else
|
||||
ret = -ENODATA;
|
||||
}
|
||||
if (create && !ret && iomap.type == IOMAP_HOLE)
|
||||
ret = gfs2_iomap_alloc(inode, &iomap, &mp);
|
||||
release_metapath(&mp);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 (gfs2_testbit(&rbm, false) != type)
|
||||
error = -ESTALE;
|
||||
if (!WARN_ON_ONCE(error)) {
|
||||
if (gfs2_testbit(&rbm, false) != type)
|
||||
error = -ESTALE;
|
||||
}
|
||||
|
||||
gfs2_glock_dq_uninit(&rgd_gh);
|
||||
|
||||
fail:
|
||||
return error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user