Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 043b19cd authored by Al Viro's avatar Al Viro Committed by David Teigland
Browse files

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent a9cc9159
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;