@@ -965,13 +965,16 @@ static void gfs2_try_evict(struct gfs2_glock *gl)
965
965
966
966
/*
967
967
* 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.
971
973
*
972
974
* The remote node is likely still holding the corresponding inode
973
975
* 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().)
975
978
*/
976
979
spin_lock (& gl -> gl_lockref .lock );
977
980
ip = gl -> gl_object ;
@@ -1027,26 +1030,8 @@ static void delete_work_func(struct work_struct *work)
1027
1030
struct gfs2_sbd * sdp = gl -> gl_name .ln_sbd ;
1028
1031
bool verify_delete = test_and_clear_bit (GLF_VERIFY_DELETE , & gl -> gl_flags );
1029
1032
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 ))
1048
1034
gfs2_try_evict (gl );
1049
- }
1050
1035
1051
1036
if (verify_delete ) {
1052
1037
u64 no_addr = gl -> gl_name .ln_number ;
0 commit comments