Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* Re: [PATCH] docs/power: note Btrfs limitation with FIBMAP for swap file offset
       [not found] <20260512063713.77200-1-arunraobalappa@gmail.com>
@ 2026-05-12  8:01 ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-05-12  8:01 UTC (permalink / raw)
  To: Arun Rao Balappa
  Cc: linux-pm, rafael, lenb, pavel, linux-kernel, linux-btrfs,
	linux-fsdevel

On Tue, May 12, 2026 at 12:07:13PM +0530, Arun Rao Balappa wrote:
> On Btrfs, the FIBMAP ioctl does not return physical block addresses.

On btrfs, and on anything that writes out of place or uses multiple
devices for that matter, FIBMAP is not implemented.

> Tools such as filefrag therefore cannot determine the correct swap file
> offset for use as resume_offset. Document the correct btrfs-progs
> command to use instead.

All of this is inherently unsafe.  File systems and do move file data
without notifying users.  This document is a really bad idea and
should be removed as we should not encourage users to rely on these
kinds of hacks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs/power: note Btrfs limitation with FIBMAP for swap file offset
@ 2026-05-12  9:42 Arun Rao
  2026-05-15 13:23 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Rao @ 2026-05-12  9:42 UTC (permalink / raw)
  To: hch
  Cc: Arun, lenb, linux-btrfs, linux-fsdevel, linux-kernel, linux-pm,
	pavel, rafael

Understood. My intent was mainly to document the current behaviour
observed by users on Btrfs systems where filefrag/FIBMAP-based
guidance fails, and to point users toward the existing btrfs-progs
tooling.

That said, I understand the concern about encouraging users to rely on
resume_offset-based workflows in general given the underlying
fragility of file block mappings on moving or CoW filesystems.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs/power: note Btrfs limitation with FIBMAP for swap file offset
  2026-05-12  9:42 [PATCH] docs/power: note Btrfs limitation with FIBMAP for swap file offset Arun Rao
@ 2026-05-15 13:23 ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-05-15 13:23 UTC (permalink / raw)
  To: Arun Rao
  Cc: hch, Arun, lenb, linux-btrfs, linux-fsdevel, linux-kernel,
	linux-pm, pavel, rafael

On Tue, May 12, 2026 at 03:12:44PM +0530, Arun Rao wrote:
> Understood. My intent was mainly to document the current behaviour
> observed by users on Btrfs systems where filefrag/FIBMAP-based
> guidance fails, and to point users toward the existing btrfs-progs
> tooling.
> 
> That said, I understand the concern about encouraging users to rely on
> resume_offset-based workflows in general given the underlying
> fragility of file block mappings on moving or CoW filesystems.

Yes.  Can you maybe extend the text a bit to generally warn about this?

I also realized that filefrag uses FIEMAP by default these days and not
just FIBMAP, which is what makes it so dangerous on btrfs.  btrfs
smartly does not implement ->bmap, but it does implement FIEMAP in
this weird way mapping to the logical address space.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-15 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12  9:42 [PATCH] docs/power: note Btrfs limitation with FIBMAP for swap file offset Arun Rao
2026-05-15 13:23 ` Christoph Hellwig
     [not found] <20260512063713.77200-1-arunraobalappa@gmail.com>
2026-05-12  8:01 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox