Skip to content

Instantly share code, notes, and snippets.

@medigeek
Created March 9, 2012 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save medigeek/2008578 to your computer and use it in GitHub Desktop.
Save medigeek/2008578 to your computer and use it in GitHub Desktop.
libarchive 3.x - quilt patch: Ignore FIEMAP errors on linux < 2.6.28 - e.g. https://bugs.launchpad.net/bugs/942994
Origin: https://code.google.com/p/libarchive/issues/detail?id=238
Description: Ignore FIEMAP errors on linux < 2.6.28
(most launchpad build daemon servers use ubuntu hardy)
https://bugs.launchpad.net/bugs/942994
Index: libarchive-3.0.3/libarchive/archive_read_disk_entry_from_file.c
===================================================================
--- libarchive-3.0.3.orig/libarchive/archive_read_disk_entry_from_file.c 2012-03-15 23:48:52.000000000 +0100
+++ libarchive-3.0.3/libarchive/archive_read_disk_entry_from_file.c 2012-03-15 23:49:00.000000000 +0100
@@ -855,16 +855,9 @@
r = ioctl(fd, FS_IOC_FIEMAP, fm);
if (r < 0) {
- /* When errno is ENOTTY, it is better we should
+ /* When errno is non-zero, 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;
- }
+ * (<2.6.28) cannot perfom FS_IOC_FIEMAP. */
goto exit_setup_sparse;
}
if (fm->fm_mapped_extents == 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment