Skip to content

Commit

Permalink
dlm: fix dlm_dir_lookup() handling of too long names
Browse files Browse the repository at this point in the history
... those can happen and BUG() from DLM_ASSERT() in allocate_direntry() is
not a good way to handle them.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Al Viro authored and David Teigland committed Feb 4, 2008
1 parent a9cc915 commit 043b19c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/dlm/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ static int get_entry(struct dlm_ls *ls, int nodeid, char *name,

write_unlock(&ls->ls_dirtbl[bucket].lock);

if (namelen > DLM_RESNAME_MAXLEN)
return -EINVAL;

de = kzalloc(sizeof(struct dlm_direntry) + namelen, GFP_KERNEL);
if (!de)
return -ENOMEM;
Expand Down

0 comments on commit 043b19c

Please sign in to comment.