From: Nikolay Borisov <nborisov@suse.com>
To: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: subvolume: outputs message only when operation succeeds
Date: Mon, 25 Sep 2017 10:30:15 +0300 [thread overview]
Message-ID: <3b6d4951-dd71-989d-3287-12ffe643bfae@suse.com> (raw)
In-Reply-To: <cdca7f92-93c0-9906-f2ed-57c3d0a97fae@jp.fujitsu.com>
On 19.09.2017 10:41, Misono, Tomohiro wrote:
> "btrfs subvolume create/delete" outputs the message of "Create/Delete
> subvolume ..." even when an operation fails.
> Since it is confusing, let's outputs the message only when an operation succeeds.
>
> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
> ---
> cmds-subvolume.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/cmds-subvolume.c b/cmds-subvolume.c
> index 666f6e0..6d4b0fe 100644
> --- a/cmds-subvolume.c
> +++ b/cmds-subvolume.c
> @@ -189,7 +189,6 @@ static int cmd_subvol_create(int argc, char **argv)
> if (fddst < 0)
> goto out;
>
> - printf("Create subvolume '%s/%s'\n", dstdir, newname);
> if (inherit) {
> struct btrfs_ioctl_vol_args_v2 args;
>
> @@ -213,6 +212,7 @@ static int cmd_subvol_create(int argc, char **argv)
> error("cannot create subvolume: %s", strerror(errno));
> goto out;
> }
> + printf("Create subvolume '%s/%s'\n", dstdir, newname);
Please change the verb to past tense, more strongly signaling success -
i.e. "Created subvolume"
>
> retval = 0; /* success */
> out:
> @@ -337,9 +337,6 @@ again:
> goto out;
> }
>
> - printf("Delete subvolume (%s): '%s/%s'\n",
> - commit_mode == 2 || (commit_mode == 1 && cnt + 1 == argc)
> - ? "commit" : "no-commit", dname, vname);
> memset(&args, 0, sizeof(args));
> strncpy_null(args.name, vname);
> res = ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args);
> @@ -349,6 +346,9 @@ again:
> ret = 1;
> goto out;
> }
> + printf("Delete subvolume (%s): '%s/%s'\n",
> + commit_mode == 2 || (commit_mode == 1 && cnt + 1 == argc)
> + ? "commit" : "no-commit", dname, vname);
Ditto: "Deleted subvolume"
>
> if (commit_mode == 1) {
> res = wait_for_commit(fd);
>
next prev parent reply other threads:[~2017-09-25 7:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 7:41 [PATCH] btrfs-progs: subvolume: outputs message only when operation succeeds Misono, Tomohiro
2017-09-20 2:32 ` Satoru Takeuchi
2017-09-25 7:30 ` Nikolay Borisov [this message]
2017-09-25 7:42 ` Marat Khalili
2017-09-25 7:43 ` Hugo Mills
2017-09-25 7:46 ` Qu Wenruo
2017-09-25 7:52 ` Hugo Mills
2017-09-25 8:04 ` Qu Wenruo
2017-09-25 8:08 ` Qu Wenruo
2017-09-25 9:27 ` Marat Khalili
2017-09-25 14:19 ` Hugo Mills
2017-09-25 14:33 ` Qu Wenruo
2017-09-25 15:17 ` Marat Khalili
2017-09-25 16:11 ` Wrong device? linux-btrfs
2017-09-26 7:31 ` Lukas Pirl
2017-09-27 14:06 ` Andrei Borzenkov
2017-09-26 8:06 ` Duncan
2017-09-27 8:26 ` Ari Saastamoinen
2017-09-25 9:11 ` [PATCH] btrfs-progs: subvolume: outputs message only when operation succeeds Marat Khalili
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=3b6d4951-dd71-989d-3287-12ffe643bfae@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=misono.tomohiro@jp.fujitsu.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 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).