dlm: don't allow zero length names
authorTycho Andersen <tycho@tycho.ws>
Fri, 2 Nov 2018 20:18:21 +0000 (14:18 -0600)
committerDavid Teigland <teigland@redhat.com>
Wed, 7 Nov 2018 22:10:45 +0000 (16:10 -0600)
kobject doesn't like zero length object names, so let's test for that.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lockspace.c

index 5ba94be..7b9d47f 100644 (file)
@@ -431,7 +431,7 @@ static int new_lockspace(const char *name, const char *cluster,
        int do_unreg = 0;
        int namelen = strlen(name);
 
-       if (namelen > DLM_LOCKSPACE_LEN)
+       if (namelen > DLM_LOCKSPACE_LEN || namelen == 0)
                return -EINVAL;
 
        if (!lvblen || (lvblen % 8))