@@ -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 ;
0 commit comments