Blame SOURCES/tar-1.27-sparse-stat-detection.patch

2dc9a1
diff --git a/lib/system.h b/lib/system.h
2dc9a1
index ef46267..e7f531c 100644
2dc9a1
--- a/lib/system.h
2dc9a1
+++ b/lib/system.h
2dc9a1
@@ -389,9 +389,16 @@ extern int errno;
2dc9a1
 # define ST_NBLOCKSIZE 512
2dc9a1
 #endif
2dc9a1
 
2dc9a1
+/* Network Appliance file systems store small files directly in the
2dc9a1
+   inode if st_size <= 64; in this case the number of blocks can be
2dc9a1
+   zero.  Perhaps other file systems have similar problems; so,
2dc9a1
+   somewhat arbitrarily, do not consider a file to be sparse if
2dc9a1
+   it has no blocks but st_size < ST_NBLOCKSIZE.  */
2dc9a1
 #define ST_IS_SPARSE(st)                                  \
2dc9a1
   (ST_NBLOCKS (st)                                        \
2dc9a1
-    < ((st).st_size / ST_NBLOCKSIZE + ((st).st_size % ST_NBLOCKSIZE != 0)))
2dc9a1
+   < ((st).st_size / ST_NBLOCKSIZE			  \
2dc9a1
+      + ((st).st_size % ST_NBLOCKSIZE != 0		  \
2dc9a1
+	 && (st).st_size / ST_NBLOCKSIZE != 0)))
2dc9a1
 
2dc9a1
 /* Declare standard functions.  */
2dc9a1