Re: [PATCH v2 04/13] NFS: add cross file system check for copy_file_range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 25, 2018 at 6:28 PM Olga Kornievskaia
<olga.kornievskaia@xxxxxxxxx> wrote:
>
> On Thu, Oct 25, 2018 at 12:38 AM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> >
> > On Wed, Oct 24, 2018 at 10:59 PM Olga Kornievskaia
> > <olga.kornievskaia@xxxxxxxxx> wrote:
> > >
> > > From: Olga Kornievskaia <kolga@xxxxxxxxxx>
> > >
> > > VFS copy_file_range was relaxed to allow for cross-device copy.
> > > Add a check to disallow cross file systems copy offload, both
> > > files are expected to be of NFS type.
> > >
> > > Signed-off-by: Olga Kornievskaia <kolga@xxxxxxxxxx>
> > > ---
> > >  fs/nfs/nfs4file.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
> > > index 4288a6e..7137e7b 100644
> > > --- a/fs/nfs/nfs4file.c
> > > +++ b/fs/nfs/nfs4file.c
> > > @@ -135,6 +135,9 @@ static ssize_t nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
> > >  {
> > >         ssize_t ret;
> > >
> > > +       if (file_in->f_inode->i_sb->s_type != file_out->f_inode->i_sb->s_type)
> > > +               return -EXDEV;
> > > +
> >
> > You would need to doo  the patches in following order:
> > 1. add same sb check in nfs
> > 2. relax same sb check in vfs
> > 3. implement cross fs copy in nfs
> > 4. relax same sb to same sb type in nfs
>
> Thank you, I will reorder the patches.
>

On second thought, It's probably best to do #1 (for nfs, cifs, ovl) + #2
in the same patch, to prevent someone from backporting just #2
without #1.

Let me know if this was too cryptic.

Thanks,
Amir.



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux