Skip to content

smalle cleanup + get_fs_info rework

Eric Sandeen linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs-progs: close fd on return from label get/set functionsutils.c+2 -00 replies
2/4btrfs-progs: three new device/path helpersutils.c utils.h+87 -00 replies
3/4btrfs-progs: don't open-code mountpoint discovery in scrub cancelcmds-scrub.c+17 -360 replies
4/4btrfs-progs: rework get_fs_info to remove side effectscmds-device.c cmds-replace.c cmds-scrub.c +2 more+66 -304 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] smalle cleanup + get_fs_info rework

The first patch is a trival close of fd on function returns, somehow missed that last go-round.

The next 3 are a little more substantial, working to avoid the nasty behavior of get_fs_info, closing & re-opening the callers' filehandle out of scope, if it needs to switch from device node to mountpoint.

(I suppose we could pass in *fd by reference, but this behavior just seems like a wrong, magical side effect for get_fs_info).

So instead, the callers use a helper to *always* wind up with the mountpoint opened, and get_fs_info() now *only* - well - only gets fs info. The previous behavior of "if given a device act only on that device; if given a mountpoint act on all devices" should persist; I guess that's the original intent.

It's really only lightly tested; it should mostly affect:

* btrfs device stats
* btrfs replace start
* btrfs scrub start
* btrfs scrub status

so any independent sanity testing of that would be great. It'l be nice if/when we get xfstests coverage of some of this to make it easier. :)

Thanks,
-Eric