Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+10 -12
+1 -1
fs/gfs2/aops.c
··· 77 77 if (error) 78 78 return error; 79 79 if (!buffer_mapped(bh_result)) 80 - return -EIO; 80 + return -ENODATA; 81 81 return 0; 82 82 } 83 83
+2 -6
fs/gfs2/bmap.c
··· 1301 1301 trace_gfs2_bmap(ip, bh_map, lblock, create, 1); 1302 1302 1303 1303 ret = gfs2_iomap_get(inode, pos, length, flags, &iomap, &mp); 1304 - if (!ret && iomap.type == IOMAP_HOLE) { 1305 - if (create) 1306 - ret = gfs2_iomap_alloc(inode, &iomap, &mp); 1307 - else 1308 - ret = -ENODATA; 1309 - } 1304 + if (create && !ret && iomap.type == IOMAP_HOLE) 1305 + ret = gfs2_iomap_alloc(inode, &iomap, &mp); 1310 1306 release_metapath(&mp); 1311 1307 if (ret) 1312 1308 goto out;
+2
fs/gfs2/log.c
··· 132 132 spin_unlock(&sdp->sd_ail_lock); 133 133 ret = generic_writepages(mapping, wbc); 134 134 spin_lock(&sdp->sd_ail_lock); 135 + if (ret == -ENODATA) /* if a jdata write into a new hole */ 136 + ret = 0; /* ignore it */ 135 137 if (ret || wbc->nr_to_write <= 0) 136 138 break; 137 139 return -EBUSY;
+5 -5
fs/gfs2/rgrp.c
··· 2529 2529 2530 2530 rbm.rgd = rgd; 2531 2531 error = gfs2_rbm_from_block(&rbm, no_addr); 2532 - if (WARN_ON_ONCE(error)) 2533 - goto fail; 2534 - 2535 - if (gfs2_testbit(&rbm, false) != type) 2536 - error = -ESTALE; 2532 + if (!WARN_ON_ONCE(error)) { 2533 + if (gfs2_testbit(&rbm, false) != type) 2534 + error = -ESTALE; 2535 + } 2537 2536 2538 2537 gfs2_glock_dq_uninit(&rgd_gh); 2538 + 2539 2539 fail: 2540 2540 return error; 2541 2541 }