lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <CAO3qy=HA2K9j0a86R1EyM-zCnQxEgUVP-trr_5cgaeJThmrWyQ@mail.gmail.com> Date: Mon, 16 Jan 2017 19:59:17 +0300 From: Artem Blagodarenko <artem.blagodarenko@...gate.com> To: linux-ext4@...r.kernel.org Subject: [PATCH] mke2fs: fix coping of empty file using fiemap During filesystem creation with -d option files copied from given directory. If supported, FS_IOC_FIEMAP ioctl is used to get file extents. For empty file fm_mapped_extents is 0 and no error code is returned, because this is not fail situation. Without this patch errno from previous operation is returned and successful FS_IOC_FIEMAP ioctl call for empty file is interpreted as error. Signed-off-by: Artem Blagodarenko <artem.blagodarenko@...gate.com> --- misc/create_inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/misc/create_inode.c b/misc/create_inode.c index 5122e56..6083d94 100644 --- a/misc/create_inode.c +++ b/misc/create_inode.c @@ -510,7 +510,7 @@ static errcode_t try_fiemap_copy(ext2_filsys fs, int fd, ext2_file_t e2_file, if (err < 0 && (errno == EOPNOTSUPP || errno == ENOTTY)) { err = EXT2_ET_UNIMPLEMENTED; goto out; - } else if (err < 0 || fiemap_buf->fm_mapped_extents == 0) { + } else if (err < 0 && fiemap_buf->fm_mapped_extents == 0) { err = errno; goto out; } -- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists