]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix issue 238.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 5 Feb 2012 19:51:16 +0000 (04:51 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 13 Mar 2012 06:40:10 +0000 (15:40 +0900)
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

index bce4beb208cd41ab04204d0e9850cc5d36a341ef..1f83189a8c0c14f1662c26907d95f6e6ad1db19c 100644 (file)
@@ -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)