diff options
author | David Teigland <teigland@redhat.com> | 2012-06-14 13:17:32 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2012-07-16 15:18:01 -0400 |
commit | 05c32f47bfae74dabff05208957768078b53cc49 (patch) | |
tree | 71034eba054f49723a0dac41f6bcd9d4f37eb2bc /fs/dlm/dlm_internal.h | |
parent | 1d7c484eeb167fc374294e38ae402de4097c8611 (diff) |
dlm: fix race between remove and lookup
It was possible for a remove message on an old
rsb to be sent after a lookup message on a new
rsb, where the rsbs were for the same resource
name. This could lead to a missing directory
entry for the new rsb.
It is fixed by keeping a copy of the resource
name being removed until after the remove has
been sent. A lookup checks if this in-progress
remove matches the name it is looking up.
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/dlm_internal.h')
-rw-r--r-- | fs/dlm/dlm_internal.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index a5f82d5b3946..9d3e485f88c8 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h | |||
@@ -498,6 +498,13 @@ struct rcom_lock { | |||
498 | char rl_lvb[0]; | 498 | char rl_lvb[0]; |
499 | }; | 499 | }; |
500 | 500 | ||
501 | /* | ||
502 | * The max number of resources per rsbtbl bucket that shrink will attempt | ||
503 | * to remove in each iteration. | ||
504 | */ | ||
505 | |||
506 | #define DLM_REMOVE_NAMES_MAX 8 | ||
507 | |||
501 | struct dlm_ls { | 508 | struct dlm_ls { |
502 | struct list_head ls_list; /* list of lockspaces */ | 509 | struct list_head ls_list; /* list of lockspaces */ |
503 | dlm_lockspace_t *ls_local_handle; | 510 | dlm_lockspace_t *ls_local_handle; |
@@ -531,6 +538,12 @@ struct dlm_ls { | |||
531 | int ls_new_rsb_count; | 538 | int ls_new_rsb_count; |
532 | struct list_head ls_new_rsb; /* new rsb structs */ | 539 | struct list_head ls_new_rsb; /* new rsb structs */ |
533 | 540 | ||
541 | spinlock_t ls_remove_spin; | ||
542 | char ls_remove_name[DLM_RESNAME_MAXLEN+1]; | ||
543 | char *ls_remove_names[DLM_REMOVE_NAMES_MAX]; | ||
544 | int ls_remove_len; | ||
545 | int ls_remove_lens[DLM_REMOVE_NAMES_MAX]; | ||
546 | |||
534 | struct list_head ls_nodes; /* current nodes in ls */ | 547 | struct list_head ls_nodes; /* current nodes in ls */ |
535 | struct list_head ls_nodes_gone; /* dead node list, recovery */ | 548 | struct list_head ls_nodes_gone; /* dead node list, recovery */ |
536 | int ls_num_nodes; /* number of nodes in ls */ | 549 | int ls_num_nodes; /* number of nodes in ls */ |