Linux-CIFS Archive on lore.kernel.org
 help / color / Atom feed
From: Murphy Zhou <jencce.kernel@gmail.com>
To: Steve French <smfrench@gmail.com>
Cc: Murphy Zhou <jencce.kernel@gmail.com>,
	CIFS <linux-cifs@vger.kernel.org>,
	Ronnie Sahlberg <lsahlber@redhat.com>,
	Steve French <sfrench@samba.org>
Subject: Re: [PATCH v3] CIFS: check new file size when extending file by fallocate
Date: Mon, 23 Mar 2020 08:24:28 +0800
Message-ID: <20200323002428.ih7nchj5tnbuppeb@xzhoux.usersys.redhat.com> (raw)
In-Reply-To: <CAH2r5muTx3DmGZ+ZedrNmPK8ZHq10XZ3RXxVD0H6RmEcBvnVPQ@mail.gmail.com>

Hi Steve,

On Wed, Mar 18, 2020 at 10:36:54PM -0500, Steve French wrote:
> Merged into cifs-2.6.git for-next

I don't see this in for-next. Is it for 5.7?

So does this one:
cifs: allow unlock flock and OFD lock across fork

Thanks!
> 
> On Wed, Mar 18, 2020, 07:48 Murphy Zhou <jencce.kernel@gmail.com> wrote:
> 
> > xfstests generic/228 checks if fallocate respect RLIMIT_FSIZE.
> > After fallocate mode 0 extending enabled, we can hit this failure.
> > Fix this by check the new file size with vfs helper, return
> > error if file size is larger then RLIMIT_FSIZE(ulimit -f).
> >
> > This patch has been tested by LTP/xfstests aginst samba and
> > Windows server.
> >
> > Acked-by: ronnie sahlberg <ronniesahlberg@gmail.com>
> > Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> > ---
> >
> > v2:
> >   Use (off+len) instead of eof for correct argument type.
> > v3:
> >   Fix Ronnie's email address.
> >
> >  fs/cifs/smb2ops.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> > index c31e84ee3c39..f221a01f62bd 100644
> > --- a/fs/cifs/smb2ops.c
> > +++ b/fs/cifs/smb2ops.c
> > @@ -3246,6 +3246,10 @@ static long smb3_simple_falloc(struct file *file,
> > struct cifs_tcon *tcon,
> >          * Extending the file
> >          */
> >         if ((keep_size == false) && i_size_read(inode) < off + len) {
> > +               rc = inode_newsize_ok(inode, off + len);
> > +               if (rc)
> > +                       goto out;
> > +
> >                 if ((cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) == 0)
> >                         smb2_set_sparse(xid, tcon, cfile, inode, false);
> >
> > --
> > 2.20.1
> >
> >

-- 
Murphy

  parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 12:46 Murphy Zhou
     [not found] ` <CAH2r5muTx3DmGZ+ZedrNmPK8ZHq10XZ3RXxVD0H6RmEcBvnVPQ@mail.gmail.com>
2020-03-23  0:24   ` Murphy Zhou [this message]
2020-03-23  3:36     ` Steve French
2020-03-23  3:51     ` Steve French
2020-03-23  3:52       ` Steve French
2020-03-23  5:13         ` Murphy Zhou

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=20200323002428.ih7nchj5tnbuppeb@xzhoux.usersys.redhat.com \
    --to=jencce.kernel@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=lsahlber@redhat.com \
    --cc=sfrench@samba.org \
    --cc=smfrench@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

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git