linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Eryu Guan <guaneryu@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs-progs: don't report internal dev replace result if ioctl failed
Date: Fri, 10 Oct 2014 10:20:23 +0200	[thread overview]
Message-ID: <20141010082023.GF22943@twin.jikos.cz> (raw)
In-Reply-To: <1412761349-32721-1-git-send-email-guaneryu@gmail.com>

On Wed, Oct 08, 2014 at 05:42:28PM +0800, Eryu Guan wrote:
> If BTRFS_IOC_DEV_REPLACE ioctl failed, there's no result returned to
> fill args.result, it doesn't make sense to report this internal result
> to user.
> 
> And the arg has been initialized with 0, the result is always 0, which
> is BTRFS_IOCTL_DEV_REPLACE_REPLACE_NO_ERROR, and the resulting error
> message looks confusing too:
> 
> ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt/btrfs": No such file or directory, no error
> 
> So just skip the internal dev replace result if the whole ioctl failed.

The 'no error' is confusing there, but I'm afraid we're losing some
information if the secondary result is completely dropped. How about
intializing the replace result with, eg., -1 and then print an empty
string from replace_dev_result2string instead?

  parent reply	other threads:[~2014-10-10  8:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08  9:42 [PATCH 1/2] btrfs-progs: don't report internal dev replace result if ioctl failed Eryu Guan
2014-10-08  9:42 ` [PATCH 2/2] btrfs-progs: return error when canonicalize_path failed Eryu Guan
2014-10-10  8:20 ` David Sterba [this message]
2014-10-10 11:02   ` [PATCH 1/2] btrfs-progs: don't report internal dev replace result if ioctl failed Eryu Guan
2014-10-10 13:16   ` [PATCH v2 1/2] btrfs-progs: only report internal dev replace result if there's a result Eryu Guan

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=20141010082023.GF22943@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=guaneryu@gmail.com \
    --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).