From: David Sterba <dave@jikos.cz>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: fix return value of setflags ioctl
Date: Thu, 24 Feb 2011 11:33:35 +0100 [thread overview]
Message-ID: <20110224103335.GA17108@twin.jikos.cz> (raw)
In-Reply-To: <4D662708.2020700@cn.fujitsu.com>
On Thu, Feb 24, 2011 at 05:38:16PM +0800, liubo wrote:
>
> setflags ioctl should return error when any checks fail.
>
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> ---
> fs/btrfs/ioctl.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 02d224e..e397da4 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -213,9 +213,11 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
> btrfs_end_transaction(trans, root);
>
> mnt_drop_write(file->f_path.mnt);
> +
> + ret = 0;
Technically speaking, this assignment is not necessary as any non-zero
value is caught above as a BUG_ON, but assigning it to zero definetely
helps readability.
> out_unlock:
> mutex_unlock(&inode->i_mutex);
> - return 0;
> + return ret;
Good cacth.
Reviewed-by: David Sterba <dsterba@suse.cz>
> }
>
> static int btrfs_ioctl_getversion(struct file *file, int __user *arg)
> --
prev parent reply other threads:[~2011-02-24 10:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-24 9:38 [PATCH] Btrfs: fix return value of setflags ioctl liubo
2011-02-24 10:33 ` 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=20110224103335.GA17108@twin.jikos.cz \
--to=dave@jikos.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