linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] btrfs-progs: balance --bg invocation
@ 2020-04-08 13:14 Petr Janecek
  0 siblings, 0 replies; only message in thread
From: Petr Janecek @ 2020-04-08 13:14 UTC (permalink / raw)
  To: linux-btrfs

Hi,

Whenever 'btrfs balance...' is used with '--background', there is
no error output at all, everything goes to /dev/null after fork().
This is an attempt to get some output for this type of invocation.

First patch just moves the forking after opening the directory,
so that nonexistent path type errors are shown.

Second patch adds BTRFS_IOC_BALANCE_PROGRESS ioctl to the
'--background' invocation to check that the path is a btrfs mount,
that we have the permission and that there is no balance running.
It's a racy hack, but good enough in normal situations like
forgotten sudo etc.

Third one adds the '--background' option to the
'btrfs balance --full-balance <path>' type of invocation (without
the 'start').  It's easy to do with forks moved to do_balance()
by the first patch.

Adding '--background' to the "old 'btrfs filesystem balance
<path>' syntax" would be a bit more work.  As it does not support
filters or any other option and does not display the full balance
warning, I wonder if it would be worth it at all?


Petr Janecek (3):
  btrfs-progs: move '--background' fork()s to do_balance()
  btrfs_progs: _PROGRESS ioctl for error output in do_balance()
  btrfs-progs: add '--background' option for '--full-balance'

 cmds/balance.c | 125 ++++++++++++++++++++++++++++++++++---------------
 1 file changed, 86 insertions(+), 39 deletions(-)

-- 
2.26.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-08 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-08 13:14 [RFC PATCH 0/3] btrfs-progs: balance --bg invocation Petr Janecek

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).