Skip to content

Commit a603333

Browse files
author
Andreas Gruenbacher
committed
gfs2: Update to the evict / remote delete documentation
Try to be a bit more clear and remove some duplications. We cannot actually get rid of the verification step eventually, so remove the comment saying so. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 8c21c2c commit a603333

File tree

2 files changed

+11
-26
lines changed

2 files changed

+11
-26
lines changed

fs/gfs2/glock.c

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -965,13 +965,16 @@ static void gfs2_try_evict(struct gfs2_glock *gl)
965965

966966
/*
967967
* If there is contention on the iopen glock and we have an inode, try
968-
* to grab and release the inode so that it can be evicted. This will
969-
* allow the remote node to go ahead and delete the inode without us
970-
* having to do it, which will avoid rgrp glock thrashing.
968+
* to grab and release the inode so that it can be evicted. The
969+
* GIF_DEFER_DELETE flag indicates to gfs2_evict_inode() that the inode
970+
* should not be deleted locally. This will allow the remote node to
971+
* go ahead and delete the inode without us having to do it, which will
972+
* avoid rgrp glock thrashing.
971973
*
972974
* The remote node is likely still holding the corresponding inode
973975
* glock, so it will run before we get to verify that the delete has
974-
* happened below.
976+
* happened below. (Verification is triggered by the call to
977+
* gfs2_queue_verify_delete() in gfs2_evict_inode().)
975978
*/
976979
spin_lock(&gl->gl_lockref.lock);
977980
ip = gl->gl_object;
@@ -1027,26 +1030,8 @@ static void delete_work_func(struct work_struct *work)
10271030
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
10281031
bool verify_delete = test_and_clear_bit(GLF_VERIFY_DELETE, &gl->gl_flags);
10291032

1030-
if (test_and_clear_bit(GLF_TRY_TO_EVICT, &gl->gl_flags)) {
1031-
/*
1032-
* If we can evict the inode, give the remote node trying to
1033-
* delete the inode some time before verifying that the delete
1034-
* has happened. Otherwise, if we cause contention on the inode glock
1035-
* immediately, the remote node will think that we still have
1036-
* the inode in use, and so it will give up waiting.
1037-
*
1038-
* If we can't evict the inode, signal to the remote node that
1039-
* the inode is still in use. We'll later try to delete the
1040-
* inode locally in gfs2_evict_inode.
1041-
*
1042-
* FIXME: We only need to verify that the remote node has
1043-
* deleted the inode because nodes before this remote delete
1044-
* rework won't cooperate. At a later time, when we no longer
1045-
* care about compatibility with such nodes, we can skip this
1046-
* step entirely.
1047-
*/
1033+
if (test_and_clear_bit(GLF_TRY_TO_EVICT, &gl->gl_flags))
10481034
gfs2_try_evict(gl);
1049-
}
10501035

10511036
if (verify_delete) {
10521037
u64 no_addr = gl->gl_name.ln_number;

fs/gfs2/super.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,9 +1272,9 @@ static enum evict_behavior gfs2_upgrade_iopen_glock(struct inode *inode)
12721272
* exclusive access to the iopen glock here.
12731273
*
12741274
* Otherwise, the other nodes holding the lock will be notified about
1275-
* our locking request. If they do not have the inode open, they are
1276-
* expected to evict the cached inode and release the lock, allowing us
1277-
* to proceed.
1275+
* our locking request (see iopen_go_callback()). If they do not have
1276+
* the inode open, they are expected to evict the cached inode and
1277+
* release the lock, allowing us to proceed.
12781278
*
12791279
* Otherwise, if they cannot evict the inode, they are expected to poke
12801280
* the inode glock (note: not the iopen glock). We will notice that

0 commit comments

Comments
 (0)