^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Squashfs - a compressed read only filesystem for Linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Phillip Lougher <phillip@squashfs.org.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * namei.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * This file implements code to do filename lookup in directories.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Like inodes, directories are packed into compressed metadata blocks, stored
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * in a directory table. Directories are accessed using the start address of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * the metablock containing the directory and the offset into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * decompressed block (<block, offset>).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * Directories are organised in a slightly complex way, and are not simply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * a list of file names. The organisation takes advantage of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * fact that (in most cases) the inodes of the files will be in the same
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * compressed metadata block, and therefore, can share the start block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * Directories are therefore organised in a two level list, a directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * header containing the shared start block value, and a sequence of directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * entries, each of which share the shared start block. A new directory header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * is written once/if the inode start block changes. The directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * header/directory entry list is repeated as many times as necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * Directories are sorted, and can contain a directory index to speed up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * file lookup. Directory indexes store one entry per metablock, each entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * storing the index/filename mapping to the first directory header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * in each metadata block. Directories are sorted in alphabetical order,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * and at lookup the index is scanned linearly looking for the first filename
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * alphabetically larger than the filename being looked up. At this point the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * location of the metadata block the filename is in has been found.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * The general idea of the index is ensure only one metadata block needs to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * decompressed to do a lookup irrespective of the length of the directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * This scheme has the advantage that it doesn't require extra memory overhead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * and doesn't require much extra storage on disk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #include <linux/vfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #include <linux/string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #include <linux/dcache.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #include <linux/xattr.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #include "squashfs_fs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #include "squashfs_fs_sb.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #include "squashfs_fs_i.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #include "squashfs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #include "xattr.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * Lookup name in the directory index, returning the location of the metadata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * block containing it, and the directory index this represents.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * If we get an error reading the index then return the part of the index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) * (if any) we have managed to read - the index isn't essential, just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * quicker.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) static int get_dir_index_using_name(struct super_block *sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) u64 *next_block, int *next_offset, u64 index_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) int index_offset, int i_count, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) struct squashfs_sb_info *msblk = sb->s_fs_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) int i, length = 0, err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) unsigned int size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) struct squashfs_dir_index *index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) char *str;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) index = kmalloc(sizeof(*index) + SQUASHFS_NAME_LEN * 2 + 2, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) if (index == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) ERROR("Failed to allocate squashfs_dir_index\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) str = &index->name[SQUASHFS_NAME_LEN + 1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) strncpy(str, name, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) str[len] = '\0';
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) for (i = 0; i < i_count; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) err = squashfs_read_metadata(sb, index, &index_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) &index_offset, sizeof(*index));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) if (err < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) size = le32_to_cpu(index->size) + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) if (size > SQUASHFS_NAME_LEN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) err = squashfs_read_metadata(sb, index->name, &index_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) &index_offset, size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) if (err < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) index->name[size] = '\0';
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) if (strcmp(index->name, str) > 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) length = le32_to_cpu(index->index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) *next_block = le32_to_cpu(index->start_block) +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) msblk->directory_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) kfree(index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * Return index (f_pos) of the looked up metadata block. Translate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) * from internal f_pos to external f_pos which is offset by 3 because
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) * we invent "." and ".." entries which are not actually stored in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) * directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) return length + 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) unsigned int flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) const unsigned char *name = dentry->d_name.name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) int len = dentry->d_name.len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) struct inode *inode = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) struct squashfs_sb_info *msblk = dir->i_sb->s_fs_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) struct squashfs_dir_header dirh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) struct squashfs_dir_entry *dire;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) u64 block = squashfs_i(dir)->start + msblk->directory_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) int offset = squashfs_i(dir)->offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) int err, length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) unsigned int dir_count, size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) TRACE("Entered squashfs_lookup [%llx:%x]\n", block, offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) dire = kmalloc(sizeof(*dire) + SQUASHFS_NAME_LEN + 1, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) if (dire == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) ERROR("Failed to allocate squashfs_dir_entry\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) return ERR_PTR(-ENOMEM);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) if (len > SQUASHFS_NAME_LEN) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) err = -ENAMETOOLONG;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) goto failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) length = get_dir_index_using_name(dir->i_sb, &block, &offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) squashfs_i(dir)->dir_idx_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) squashfs_i(dir)->dir_idx_offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) squashfs_i(dir)->dir_idx_cnt, name, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) while (length < i_size_read(dir)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * Read directory header.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) err = squashfs_read_metadata(dir->i_sb, &dirh, &block,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) &offset, sizeof(dirh));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) if (err < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) goto read_failure;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) length += sizeof(dirh);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) dir_count = le32_to_cpu(dirh.count) + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) if (dir_count > SQUASHFS_DIR_COUNT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) goto data_error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) while (dir_count--) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) * Read directory entry.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) err = squashfs_read_metadata(dir->i_sb, dire, &block,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) &offset, sizeof(*dire));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) if (err < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) goto read_failure;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) size = le16_to_cpu(dire->size) + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) /* size should never be larger than SQUASHFS_NAME_LEN */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) if (size > SQUASHFS_NAME_LEN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) goto data_error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) err = squashfs_read_metadata(dir->i_sb, dire->name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) &block, &offset, size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) if (err < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) goto read_failure;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) length += sizeof(*dire) + size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) if (name[0] < dire->name[0])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) goto exit_lookup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) if (len == size && !strncmp(name, dire->name, len)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) unsigned int blk, off, ino_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) long long ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) blk = le32_to_cpu(dirh.start_block);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) off = le16_to_cpu(dire->offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) ino_num = le32_to_cpu(dirh.inode_number) +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) (short) le16_to_cpu(dire->inode_number);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) ino = SQUASHFS_MKINODE(blk, off);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) TRACE("calling squashfs_iget for directory "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) "entry %s, inode %x:%x, %d\n", name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) blk, off, ino_num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) inode = squashfs_iget(dir->i_sb, ino, ino_num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) goto exit_lookup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) exit_lookup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) kfree(dire);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) return d_splice_alias(inode, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) data_error:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) err = -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) read_failure:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) ERROR("Unable to read directory block [%llx:%x]\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) squashfs_i(dir)->start + msblk->directory_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) squashfs_i(dir)->offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) failed:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) kfree(dire);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) return ERR_PTR(err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) const struct inode_operations squashfs_dir_inode_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) .lookup = squashfs_lookup,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) .listxattr = squashfs_listxattr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) };