From: Steve French <smfrench@gmail.com>
To: ronnie sahlberg <ronniesahlberg@gmail.com>
Cc: "Aurélien Aptel" <aaptel@suse.com>,
"Ronnie Sahlberg" <lsahlber@redhat.com>,
linux-cifs <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] cifs: add support for FALLOC_FL_COLLAPSE_RANGE
Date: Tue, 30 Mar 2021 17:15:21 -0500 [thread overview]
Message-ID: <CAH2r5mua0KMT4-=WT3_a2iTJfke4jbuJ-=FnTc03JD13yE9bRg@mail.gmail.com> (raw)
In-Reply-To: <CAN05THR6kWTL0qyCAoYc1p7bguAS7okxQ0jRDigfyXaE_jr5eA@mail.gmail.com>
On Tue, Mar 30, 2021 at 5:09 PM ronnie sahlberg
<ronniesahlberg@gmail.com> wrote:
>
> On Wed, Mar 31, 2021 at 12:22 AM Aurélien Aptel <aaptel@suse.com> wrote:
> >
> > Ronnie Sahlberg <lsahlber@redhat.com> writes:
> > > +static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
> > > + loff_t off, loff_t len)
> > > +{
> > > + int rc;
> > > + unsigned int xid;
> > > + struct cifsFileInfo *cfile = file->private_data;
> > > + __le64 eof;
> > > +
> > > + xid = get_xid();
> > > +
> > > + if (off + len < off) {
> > > + rc = -EFBIG;
> > > + goto out;
> > > + }
> >
> > loff_t is defined as 'long long' for me which is signed, and signed
> > overflow is Undefined Behaviour, unless we compile with -fwrapv which
> > I'm not sure it is something we can assume.
> >
> > Also, vfs_fallocate() in fs/open.c already does an overflow check before
> > calling f_op->falloc(), this is probably not needed. (It's also relying
> > on signed overflow so I guess it is ok...?)
>
> Thanks.
> Steve, can you drop this check from the patch?
Yes. I was trying to run some xfstests on it vs. Windows with REFS
(and Samba with BTRFS after that). Any observations on these two
patches and xfstests?
> > Rest of the patch looks good otherwise.
> >
> > Cheers,
> > --
> > Aurélien Aptel / SUSE Labs Samba Team
--
Thanks,
Steve
next prev parent reply other threads:[~2021-03-30 22:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-26 19:52 [PATCH] cifs: add support for FALLOC_FL_COLLAPSE_RANGE Ronnie Sahlberg
2021-03-30 14:21 ` Aurélien Aptel
2021-03-30 22:09 ` ronnie sahlberg
2021-03-30 22:15 ` Steve French [this message]
2021-04-01 5:41 ` Steve French
-- strict thread matches above, loose matches on Subject: below --
2021-03-26 1:31 Ronnie Sahlberg
2021-03-26 5:58 ` kernel test robot
2021-03-26 8:35 ` Dan Carpenter
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='CAH2r5mua0KMT4-=WT3_a2iTJfke4jbuJ-=FnTc03JD13yE9bRg@mail.gmail.com' \
--to=smfrench@gmail.com \
--cc=aaptel@suse.com \
--cc=linux-cifs@vger.kernel.org \
--cc=lsahlber@redhat.com \
--cc=ronniesahlberg@gmail.com \
/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).