From 293687358e2c52213a3f077bb3d8f860ea5bfda9 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Mon, 6 Feb 2012 04:51:16 +0900 Subject: [PATCH] Fix issue 238. Skip the setup sparse on linux without a check of errno if ioctl(,FS_IOC_FIEMAP,) failed because the errno is not fixed , for example, some file system returns ENOTTY, another returns EOPNOTSUPP, or EINVAL and so on. We cannot decide what errno exactly indicates an unsupported error. --- libarchive/archive_read_disk_entry_from_file.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c index eef42ef74..6415008 100644 --- a/libarchive/archive_read_disk_entry_from_file.c +++ b/libarchive/archive_read_disk_entry_from_file.c @@ -859,16 +859,9 @@ setup_sparse(struct archive_read_disk *a, r = ioctl(fd, FS_IOC_FIEMAP, fm); if (r < 0) { - /* When errno is ENOTTY, it is better we should - * return ARCHIVE_OK because an earlier version - *(<2.6.28) cannot perfom FS_IOC_FIEMAP. - * We should also check if errno is EOPNOTSUPP, - * it means "Operation not supported". */ - if (errno != ENOTTY && errno != EOPNOTSUPP) { - archive_set_error(&a->archive, errno, - "FIEMAP failed"); - exit_sts = ARCHIVE_FAILED; - } + /* When something error happens, it is better we + * should return ARCHIVE_OK because an earlier + * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */ goto exit_setup_sparse; } if (fm->fm_mapped_extents == 0) -- 1.7.9.2