[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191222031636.GA43673@ubuntu-m2-xlarge-x86>
Date: Sat, 21 Dec 2019 20:16:36 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: David Sterba <dsterba@...e.cz>
Cc: Al Viro <viro@...iv.linux.org.uk>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH v2] vfs: Adjust indentation in remap_verify_area
On Wed, Dec 18, 2019 at 12:04:37PM +0100, David Sterba wrote:
> 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@...il.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/
I do not particularly care how this warning gets fixed, just that it
does. I will review that patch like Nick did.
Cheers,
Nathan
Powered by blists - more mailing lists