linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: linux-fsdevel@vger.kernel.org
Cc: Josef Bacik <jbacik@fb.com>
Subject: Usefulness of SEEK_HOLE / SEEK_DATA in generic_file_llseek()
Date: Tue, 24 Dec 2013 00:12:53 +0100	[thread overview]
Message-ID: <20131223231253.GA8376@quack.suse.cz> (raw)

  Hello,

  so I've now hit a xfstests failure for UDF which is caused by the
implementation of SEEK_HOLE / SEEK_DATA in generic_file_llseek(). UDF uses
that function as its .llseek method but it supports holes as any other unix
filesystem (e.g. ext2). The test in xfstests assumes that when it creates a
file by pwrite(fd, buf, bufsz, off), then SEEK_DATA on offset 0 should
return 'off' (off is reasonably rounded) but that's not true for the
implementation in generic_file_llseek().

Now I'm not so much interested in that test itself - that can be tweaked to
detect that case. But I rather wanted to ask - how useful is it to
implement SEEK_HOLE / SEEK_DATA the way it is in generic_file_llseek()?
Because it seems to me that any serious user will have to detect whether
SEEK_HOLE / SEEK_DATA works reasonably and if not, fall back to some
heuristic anyway. So why bother inventing bogus values in
generic_file_llseek and thus making detection of working implementation
harder?

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

             reply	other threads:[~2013-12-23 23:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 23:12 Jan Kara [this message]
2013-12-24  0:34 ` Usefulness of SEEK_HOLE / SEEK_DATA in generic_file_llseek() Josef Bacik
2013-12-25 14:34   ` Jeff Liu
2013-12-30 21:18   ` Jan Kara
2013-12-31  6:00     ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131223231253.GA8376@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=jbacik@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).