As Kinglong points out, the nlm_block->b_fl field is no longer used at all. Also, vfs_test_lock in the generic locking code will only return FILE_LOCK_DEFERRED if FL_SLEEP is set, and it isn't here. The only other place that returns that value is the DLM lock code, but it only does that in dlm_posix_lock, never in dlm_posix_get. Remove all of the deferred locking code from the testlock codepath since it doesn't appear to ever be used anyway. I do have a small concern that this might cause a behavior change in the case where you have a block already sitting on the list when the testlock request comes in, but that looks like it doesn't really work properly anyway. I think it's best to just pass that down to vfs_test_lock and let the filesystem report that instead of trying to infer what's going on with the lock by looking at an existing block.
Showing the changes to include/linux/lockd (1 of 2 files). Show all
Unified · Split
| @@ -178,7 +178,6 @@ struct nlm_block { · 177 unmodified lines | ||
| 178 | 178 | unsigned char b_granted; /* VFS granted lock */ |
| 179 | 179 | struct nlm_file * b_file; /* file in question */ |
| 180 | 180 | struct cache_req * b_cache_req; /* deferred request handling */ |
| 181 | − struct file_lock * b_fl; /* set for GETLK */ | |
| 182 | 181 | struct cache_deferred_req * b_deferred_req; |
| 183 | 182 | unsigned int b_flags; /* block flags */ |
| 184 | 183 | #define B_QUEUED 1 /* lock queued */ |