All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "Anna.Schumaker@netapp.com" <Anna.Schumaker@netapp.com>,
	"amir73il@gmail.com" <amir73il@gmail.com>,
	"olga.kornievskaia@gmail.com" <olga.kornievskaia@gmail.com>
Cc: "hch@lst.de" <hch@lst.de>,
	"linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>,
	"david@fromorbit.com" <david@fromorbit.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"lhenriques@suse.com" <lhenriques@suse.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"darrick.wong@oracle.com" <darrick.wong@oracle.com>
Subject: Re: [PATCH v3 12/13] nfs: copy_file_range needs to strip setuid bits and update timestamps
Date: Wed, 29 May 2019 20:02:54 +0000	[thread overview]
Message-ID: <c32af433639b451419d36382a05edabfcb742294.camel@hammerspace.com> (raw)
In-Reply-To: <CAOQ4uxgYM_eM==uqGQuKiGb+f08qs53=E+DONMMzW=N-Ab5YZA@mail.gmail.com>

On Wed, 2019-05-29 at 22:34 +0300, Amir Goldstein wrote:
> Hi Olga,Anna,Trond
> 
> Could we get an ACK on this patch.
> It is a prerequisite for merging the cross-device copy_file_range
> work.
> 
> It depends on a new helper introduced here:
> https://lore.kernel.org/linux-fsdevel/CAOQ4uxjbcSWX1hUcuXbn8hFH3QYB+5bAC9Z1yCwJdR=T-GGtCg@mail.gmail.com/T/#m1569878c41f39fac3aadb3832a30659c323b582a
> 
> Thanks,
> Amir,
> 
> On Wed, May 29, 2019 at 8:43 PM Amir Goldstein <amir73il@gmail.com>
> wrote:
> > Like ->write_iter(), we update mtime and strip setuid of dst file
> > before
> > copy and like ->read_iter(), we update atime of src file after
> > copy.
> > 
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> >  fs/nfs/nfs42proc.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
> > index 5196bfa7894d..c37a8e5116c6 100644
> > --- a/fs/nfs/nfs42proc.c
> > +++ b/fs/nfs/nfs42proc.c
> > @@ -345,10 +345,13 @@ ssize_t nfs42_proc_copy(struct file *src,
> > loff_t pos_src,
> > 
> >         do {
> >                 inode_lock(file_inode(dst));
> > -               err = _nfs42_proc_copy(src, src_lock,
> > -                               dst, dst_lock,
> > -                               &args, &res);
> > +               err = file_modified(dst);
> > +               if (!err)
> > +                       err = _nfs42_proc_copy(src, src_lock,
> > +                                              dst, dst_lock,
> > +                                              &args, &res);
> >                 inode_unlock(file_inode(dst));
> > +               file_accessed(src);
> > 
> >                 if (err >= 0)
> >                         break;
> > --
> > 2.17.1
> > 

Please drop this patch. In the NFS protocol, the client is not expected
to mess with atime or mtime other than when the user explicitly sets it
through a call to utimensat() or similar. The server takes care of any
a/mtime updates as and when the file is read/written to. 

Ditto for suid/sgid clearing.

Motto: "No file_accessed() or file_remove_privs() calls, please. We're
NFS."

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  reply	other threads:[~2019-05-29 20:03 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 17:43 [PATCH v3 00/13] Fixes for major copy_file_range() issues Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 01/13] vfs: introduce generic_copy_file_range() Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 02/13] vfs: no fallback for ->copy_file_range Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 03/13] vfs: introduce generic_file_rw_checks() Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 04/13] vfs: remove redundant checks from generic_remap_checks() Amir Goldstein
2019-05-29 18:23   ` Darrick J. Wong
2019-05-29 17:43 ` [PATCH v3 05/13] vfs: add missing checks to copy_file_range Amir Goldstein
2019-05-29 18:24   ` Darrick J. Wong
2019-05-29 17:43 ` [PATCH v3 06/13] vfs: introduce file_modified() helper Amir Goldstein
2019-05-29 18:27   ` Darrick J. Wong
2019-05-29 19:08     ` Amir Goldstein
2019-05-29 19:23       ` Amir Goldstein
2019-05-29 21:41       ` Dave Chinner
2019-05-29 17:43 ` [PATCH v3 07/13] xfs: use " Amir Goldstein
2019-05-29 18:31   ` Darrick J. Wong
2019-05-29 19:10     ` Amir Goldstein
2019-05-29 19:13       ` Darrick J. Wong
2019-05-29 17:43 ` [PATCH v3 08/13] vfs: copy_file_range needs to strip setuid bits and update timestamps Amir Goldstein
2019-05-29 18:33   ` Darrick J. Wong
2019-05-29 21:08     ` Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 09/13] ceph: " Amir Goldstein
2019-05-29 19:43   ` Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 10/13] cifs: " Amir Goldstein
2019-05-29 19:36   ` Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 11/13] fuse: " Amir Goldstein
2019-05-29 19:37   ` Amir Goldstein
2019-05-29 20:07     ` Miklos Szeredi
2019-05-29 17:43 ` [PATCH v3 12/13] nfs: " Amir Goldstein
2019-05-29 19:34   ` Amir Goldstein
2019-05-29 20:02     ` Trond Myklebust [this message]
2019-05-29 21:00       ` Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 13/13] vfs: allow copy_file_range to copy across devices Amir Goldstein
2019-05-29 20:09   ` Olga Kornievskaia
2019-05-29 21:03     ` Amir Goldstein
2019-06-03 20:39       ` Olga Kornievskaia
2019-06-04  4:11         ` Amir Goldstein
2019-05-29 17:43 ` [PATCH v3 14/13] man-pages: copy_file_range updates Amir Goldstein

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=c32af433639b451419d36382a05edabfcb742294.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=Anna.Schumaker@netapp.com \
    --cc=amir73il@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=lhenriques@suse.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=olga.kornievskaia@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.