]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/ubifs/replay.c
Merge branch 'parisc-4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[linux.git] / fs / ubifs / replay.c
index fb0f44cd1e28f8afd37314fe9da98bf06978baff..ae5c02f22f3e7ded6545fe52859abef20742d9d7 100644 (file)
@@ -61,7 +61,7 @@ struct replay_entry {
        struct list_head list;
        union ubifs_key key;
        union {
-               struct qstr nm;
+               struct fscrypt_name nm;
                struct {
                        loff_t old_size;
                        loff_t new_size;
@@ -327,7 +327,7 @@ static void destroy_replay_list(struct ubifs_info *c)
 
        list_for_each_entry_safe(r, tmp, &c->replay_list, list) {
                if (is_hash_key(c, &r->key))
-                       kfree(r->nm.name);
+                       kfree(fname_name(&r->nm));
                list_del(&r->list);
                kfree(r);
        }
@@ -430,10 +430,10 @@ static int insert_dent(struct ubifs_info *c, int lnum, int offs, int len,
        r->deletion = !!deletion;
        r->sqnum = sqnum;
        key_copy(c, key, &r->key);
-       r->nm.len = nlen;
+       fname_len(&r->nm) = nlen;
        memcpy(nbuf, name, nlen);
        nbuf[nlen] = '\0';
-       r->nm.name = nbuf;
+       fname_name(&r->nm) = nbuf;
 
        list_add_tail(&r->list, &c->replay_list);
        return 0;
@@ -456,7 +456,7 @@ int ubifs_validate_entry(struct ubifs_info *c,
        if (le32_to_cpu(dent->ch.len) != nlen + UBIFS_DENT_NODE_SZ + 1 ||
            dent->type >= UBIFS_ITYPES_CNT ||
            nlen > UBIFS_MAX_NLEN || dent->name[nlen] != 0 ||
-           strnlen(dent->name, nlen) != nlen ||
+           (key_type == UBIFS_XENT_KEY && strnlen(dent->name, nlen) != nlen) ||
            le64_to_cpu(dent->inum) > MAX_INUM) {
                ubifs_err(c, "bad %s node", key_type == UBIFS_DENT_KEY ?
                          "directory entry" : "extended attribute entry");