]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: encrypted symlinks are never fast
authorTheodore Ts'o <tytso@mit.edu>
Sun, 1 Mar 2015 21:58:46 +0000 (16:58 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 1 Mar 2015 21:58:46 +0000 (16:58 -0500)
Teach ext2fs_inodes_has_valid_blocks2() that encrypted symlinks always
use an external block (i.e., we never try to store the symlink in the
i_blocks[] array if it is encrypted).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/valid_blk.c

index db5d90ae4076d035020af61ab927417d17811bf6..cb450005dbd2936bc8b92d04605eedb48fa33178 100644 (file)
@@ -39,6 +39,8 @@ int ext2fs_inode_has_valid_blocks2(ext2_filsys fs, struct ext2_inode *inode)
         * target is stored in the block entries.
         */
        if (LINUX_S_ISLNK (inode->i_mode)) {
+               if (inode->i_flags & EXT4_ENCRYPT_FL)
+                       return 1;
                if (ext2fs_file_acl_block(fs, inode) == 0) {
                        /* With no EA block, we can rely on i_blocks */
                        if (inode->i_blocks == 0)