GNU bug report logs -
#20826
SEEK_HOLE not supported for ext4 for kernel < 3.1
Previous Next
Reported by: Johannes Meixner <jsmeix <at> suse.de>
Date: Tue, 16 Jun 2015 10:40:03 UTC
Severity: normal
Tags: wontfix
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
From one of our (SUSE) kernel developers
I even got a proposal for a workaround in grep:
--- a/src/grep.c
+++ b/src/grep.c
@@ -575,6 +575,17 @@ file_textbin (char *buf, size_t size, in
off_t hole_start = lseek (fd, cur, SEEK_HOLE);
if (0 <= hole_start)
{
+ /* if hole_start is identical with cur, it's more likely a buggy
+ * lseek(SEEK_HOLE) implementation in kernel filesystem;
+ * check whether it really reads a null byte.
+ */
+ if (hole_start == cur)
+ {
+ char c;
+ if (read (fd, &c, 1) != 1 || c != 0)
+ hole_start = st->st_size; /* no hole */
+ }
+
if (lseek (fd, cur, SEEK_SET) < 0)
suppressible_error (filename, errno);
if (hole_start < st->st_size)
This bug report was last modified 9 years and 103 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.