From 043b19cdc081f586a8f4e1c93ce6c03b63c26284 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 26 Jan 2008 00:03:59 -0500 Subject: dlm: fix dlm_dir_lookup() handling of too long names ... those can happen and BUG() from DLM_ASSERT() in allocate_direntry() is not a good way to handle them. Signed-off-by: Al Viro Signed-off-by: David Teigland --- fs/dlm/dir.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/dlm') diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 831050e5bfd5..85defeb64df4 100644 --- a/fs/dlm/dir.c +++ b/fs/dlm/dir.c @@ -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; -- cgit v1.2.2