linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Janecek <janecek@ucw.cz>
To: linux-btrfs@vger.kernel.org
Subject: [RFC PATCH 0/3] btrfs-progs: balance --bg invocation
Date: Wed, 8 Apr 2020 15:14:58 +0200	[thread overview]
Message-ID: <20200408131457.GA19101@jkm> (raw)

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


                 reply	other threads:[~2020-04-08 13:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200408131457.GA19101@jkm \
    --to=janecek@ucw.cz \
    --cc=linux-btrfs@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).