From: David Sterba <dsterba@suse.cz>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH v2] vfs: Adjust indentation in remap_verify_area
Date: Wed, 18 Dec 2019 12:04:37 +0100 [thread overview]
Message-ID: <20191218110437.GJ3929@twin.jikos.cz> (raw)
In-Reply-To: <20191218051635.38347-1-natechancellor@gmail.com>
On Tue, Dec 17, 2019 at 10:16:35PM -0700, Nathan Chancellor wrote:
> Clang's -Wmisleading-indentation caught an instance in remap_verify_area
> where there was a trailing space after a tab. Remove it to get rid of
> the warning.
>
> Fixes: 04b38d601239 ("vfs: pull btrfs clone API to vfs layer")
> Link: https://github.com/ClangBuiltLinux/linux/issues/828
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>
> v1 -> v2:
>
> * Trim warning and simplify patch explanation.
>
> fs/read_write.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 5bbf587f5bc1..c71e863163bd 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -1757,7 +1757,7 @@ static int remap_verify_area(struct file *file, loff_t pos, loff_t len,
> if (unlikely(pos < 0 || len < 0))
> return -EINVAL;
>
> - if (unlikely((loff_t) (pos + len) < 0))
> + if (unlikely((loff_t) (pos + len) < 0))
Instead of just fixing whitespace, can we please fix the undefined
behaviour on this line? pos and len are signed types, there's a helper
to do that in a way that's UB-safe.
And btw here's a patch:
https://lore.kernel.org/linux-fsdevel/20190808123942.19592-1-dsterba@suse.com/
next prev parent reply other threads:[~2019-12-18 11:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 3:23 [PATCH] vfs: Adjust indentation in remap_verify_area Nathan Chancellor
2019-12-18 3:50 ` Al Viro
2019-12-18 5:16 ` [PATCH v2] " Nathan Chancellor
2019-12-18 11:04 ` David Sterba [this message]
2019-12-22 3:16 ` Nathan Chancellor
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=20191218110437.GJ3929@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clang-built-linux@googlegroups.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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).