All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Anand Jain <anand.jain@oracle.com>
Cc: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH V2 RESEND] btrfs: pass the error code to the btrfs_std_error and log ret
Date: Mon, 2 May 2016 17:14:40 +0200	[thread overview]
Message-ID: <20160502151440.GJ29353@twin.jikos.cz> (raw)
In-Reply-To: <57268BF5.7010408@oracle.com>

On Mon, May 02, 2016 at 07:06:29AM +0800, Anand Jain wrote:
> > It's just logging an error, but it should really fail, without a
> > message. The error code will tell what went wrong. Assigning existing
> > qgroups is eg. EEXIST, if either doesn't exist then ENOENT. There's a
> > FIXME a few lines above that should be addressed.
> >
> > I'd like to avoid the message in this case because it should be handled
> > by the ioctl caller, otherwise it could be just flooding the system log.
> >
> >> +
> >>   	/* update qgroup status and info */
> >>   	err = btrfs_run_qgroups(trans, root->fs_info);
> >>   	if (err < 0)
> >> -		btrfs_std_error(root->fs_info, ret,
> >> +		btrfs_std_error(root->fs_info, err,
> 
>   This patch is missing in the 'dev-del-by-id' branch. I agree with your
>   the above comments, however the key intention of this patch was to get
>   the correct parameter passed to the btrfs_std_error(). And the above
>   btrfs_err() log should still help/motivate to get the part you
>   mentioned corrected.

Committed as

    btrfs: pass the right error code to the btrfs_std_error

    Also drop the newline from the message.

    Signed-off-by: Anand Jain <anand.jain@oracle.com>
    Signed-off-by: David Sterba <dsterba@suse.com>

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 798f58e7338e..40c62e1a4a23 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4859,8 +4859,8 @@ static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg)
        /* update qgroup status and info */
        err = btrfs_run_qgroups(trans, root->fs_info);
        if (err < 0)
-               btrfs_std_error(root->fs_info, ret,
-                           "failed to update qgroup status and info\n");
+               btrfs_std_error(root->fs_info, err,
+                           "failed to update qgroup status and info");
        err = btrfs_end_transaction(trans, root);
        if (err && !ret)
                ret = err;

      reply	other threads:[~2016-05-02 15:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10  4:22 [PATCH V2 RESEND] btrfs: pass the error code to the btrfs_std_error and log ret Anand Jain
2016-03-16 13:10 ` David Sterba
2016-05-01 23:06   ` Anand Jain
2016-05-02 15:14     ` David Sterba [this message]

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=20160502151440.GJ29353@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.