diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dlm/lock.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 0593dd81d46d..6d98cf9d043d 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c | |||
@@ -436,11 +436,15 @@ static int find_rsb(struct dlm_ls *ls, char *name, int namelen, | |||
436 | { | 436 | { |
437 | struct dlm_rsb *r, *tmp; | 437 | struct dlm_rsb *r, *tmp; |
438 | uint32_t hash, bucket; | 438 | uint32_t hash, bucket; |
439 | int error = 0; | 439 | int error = -EINVAL; |
440 | |||
441 | if (namelen > DLM_RESNAME_MAXLEN) | ||
442 | goto out; | ||
440 | 443 | ||
441 | if (dlm_no_directory(ls)) | 444 | if (dlm_no_directory(ls)) |
442 | flags |= R_CREATE; | 445 | flags |= R_CREATE; |
443 | 446 | ||
447 | error = 0; | ||
444 | hash = jhash(name, namelen, 0); | 448 | hash = jhash(name, namelen, 0); |
445 | bucket = hash & (ls->ls_rsbtbl_size - 1); | 449 | bucket = hash & (ls->ls_rsbtbl_size - 1); |
446 | 450 | ||