All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Brian Foster <bfoster@redhat.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
	Christoph Hellwig <hch@lst.de>, Eric Sandeen <sandeen@redhat.com>,
	linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH, RFC] xfs: re-enable FIBMAP on reflink; disable for swap
Date: Thu, 30 Aug 2018 14:47:09 -0500	[thread overview]
Message-ID: <3d6029ec-0afe-e90e-d608-e1c627c0818f@sandeen.net> (raw)
In-Reply-To: <20180830193919.GA35751@bfoster>

On 8/30/18 2:39 PM, Brian Foster wrote:
>>> Frankly I think FIBMAP comes verrry
>>> close to "this API is unfixably stupid and shouldn't be enabled for new
>>> use cases and should go away some day".

Backing up, the interface isn't /that/ dumb, other than being limited to
32 bits.  Q: "Where is this logical file block physically located?"  A: "It is here."

Inefficient, sure.

>> So instead if anyone asks we'll just give them a successful response which
>> is indistinguishable from a hole.  :(
>>
> ... but this seems to be the crux of the matter (IMO, at least). If we
> can return -ENOTSUPP or whatever, then it can be made obvious that the
> user either needs to use fiemap or avoid using reflinked files. ISTM
> that what we do now is essentially report an incorrect bmap, which leads
> to these subtle bug reports.
> 
> I haven't dug into the fibmap code.. does something prevent returning a
> legitimate error code?

so ->bmap() returns a sector_t, which is a u64 and doesn't really
leave room for a negative error return.  But the ioctl interface 
stuffs that return into an int, and returns it to the user.
(note to self, wonder why it doesn't return -EOVERFLOW as needed).

I suppose ->bmap() could be changed to take a u64 in/out pointer like the
user interface does, and return 0 or -errno.  *Shrug* this seems like
a lot of work to avoid simply giving the user what they asked
for.  ;)

-Eric

  reply	other threads:[~2018-08-30 23:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 16:10 [PATCH, RFC] xfs: re-enable FIBMAP on reflink; disable for swap Eric Sandeen
2018-08-30 16:25 ` Christoph Hellwig
2018-08-30 16:31   ` Eric Sandeen
2018-08-30 16:36     ` Christoph Hellwig
2018-08-30 16:35       ` Eric Sandeen
2018-08-30 18:02         ` Brian Foster
2018-08-30 18:28           ` Darrick J. Wong
2018-08-30 18:51             ` Eric Sandeen
2018-08-30 19:39               ` Brian Foster
2018-08-30 19:47                 ` Eric Sandeen [this message]
2018-08-30 19:58                   ` Brian Foster
2018-08-31  0:11               ` Dave Chinner
2018-08-31  1:34                 ` Eric Sandeen
2018-08-31  3:05                   ` Dave Chinner
2018-08-31 13:08                     ` Eric Sandeen
2018-09-01  8:32                       ` Christoph Hellwig
2018-08-31  6:28             ` Christoph Hellwig
2018-08-31 12:36               ` Brian Foster
2018-09-01  8:31                 ` Christoph Hellwig
2018-09-02 14:08                 ` Carlos Maiolino
2018-09-02 17:52                   ` Eric Sandeen
2018-09-03 10:21                     ` Carlos Maiolino

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=3d6029ec-0afe-e90e-d608-e1c627c0818f@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.