|
| 1 | +gfs2: Clean up delete work processing |
| 2 | + |
| 3 | +jira LE-3201 |
| 4 | +Rebuild_History Non-Buildable kernel-rt-4.18.0-553.27.1.rt7.368.el8_10 |
| 5 | +commit-author Andreas Gruenbacher <agruenba@redhat.com> |
| 6 | +commit 0baa10b60cddb587a1a252a8db76b0cea439d1be |
| 7 | +Empty-Commit: Cherry-Pick Conflicts during history rebuild. |
| 8 | +Will be included in final tarball splat. Ref for failed cherry-pick at: |
| 9 | +ciq/ciq_backports/kernel-rt-4.18.0-553.27.1.rt7.368.el8_10/0baa10b6.failed |
| 10 | + |
| 11 | +Function delete_work_func() was previously assuming that the |
| 12 | +GLF_TRY_TO_EVICT and GLF_VERIFY_DELETE flags won't both be set at the |
| 13 | +same time, but there probably are races in which that can happen, so |
| 14 | +handle that case correctly. |
| 15 | + |
| 16 | + Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> |
| 17 | +(cherry picked from commit 0baa10b60cddb587a1a252a8db76b0cea439d1be) |
| 18 | + Signed-off-by: Jonathan Maple <jmaple@ciq.com> |
| 19 | + |
| 20 | +# Conflicts: |
| 21 | +# fs/gfs2/glock.c |
| 22 | +diff --cc fs/gfs2/glock.c |
| 23 | +index 7369f9303901,95f082f13a8c..000000000000 |
| 24 | +--- a/fs/gfs2/glock.c |
| 25 | ++++ b/fs/gfs2/glock.c |
| 26 | +@@@ -992,8 -1028,7 +992,12 @@@ static void delete_work_func(struct wor |
| 27 | + struct delayed_work *dwork = to_delayed_work(work); |
| 28 | + struct gfs2_glock *gl = container_of(dwork, struct gfs2_glock, gl_delete); |
| 29 | + struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; |
| 30 | +++<<<<<<< HEAD |
| 31 | + + struct inode *inode; |
| 32 | + + u64 no_addr = gl->gl_name.ln_number; |
| 33 | +++======= |
| 34 | ++ bool verify_delete = test_and_clear_bit(GLF_VERIFY_DELETE, &gl->gl_flags); |
| 35 | +++>>>>>>> 0baa10b60cdd (gfs2: Clean up delete work processing) |
| 36 | + |
| 37 | + if (test_and_clear_bit(GLF_TRY_TO_EVICT, &gl->gl_flags)) { |
| 38 | + /* |
| 39 | +@@@ -1014,15 -1049,18 +1018,29 @@@ |
| 40 | + * step entirely. |
| 41 | + */ |
| 42 | + if (gfs2_try_evict(gl)) { |
| 43 | +++<<<<<<< HEAD |
| 44 | + + if (test_bit(SDF_KILL, &sdp->sd_flags)) |
| 45 | + + goto out; |
| 46 | + + if (gfs2_queue_verify_delete(gl)) |
| 47 | + + return; |
| 48 | +++======= |
| 49 | ++ if (!test_bit(SDF_KILL, &sdp->sd_flags)) { |
| 50 | ++ gfs2_glock_hold(gl); |
| 51 | ++ if (!gfs2_queue_verify_delete(gl, true)) |
| 52 | ++ gfs2_glock_put(gl); |
| 53 | ++ } |
| 54 | +++>>>>>>> 0baa10b60cdd (gfs2: Clean up delete work processing) |
| 55 | + } |
| 56 | +- goto out; |
| 57 | + } |
| 58 | + |
| 59 | +++<<<<<<< HEAD |
| 60 | + + if (test_and_clear_bit(GLF_VERIFY_DELETE, &gl->gl_flags)) { |
| 61 | +++======= |
| 62 | ++ if (verify_delete) { |
| 63 | ++ u64 no_addr = gl->gl_name.ln_number; |
| 64 | ++ struct inode *inode; |
| 65 | ++ |
| 66 | +++>>>>>>> 0baa10b60cdd (gfs2: Clean up delete work processing) |
| 67 | + inode = gfs2_lookup_by_inum(sdp, no_addr, gl->gl_no_formal_ino, |
| 68 | + GFS2_BLKST_UNLINKED); |
| 69 | + if (IS_ERR(inode)) { |
| 70 | +* Unmerged path fs/gfs2/glock.c |
0 commit comments