linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Andy Whitcroft <apw@canonical.com>
Cc: Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"mszeredi@suse.cz" <mszeredi@suse.cz>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 2/2] overlayfs -- follow change to do_splice_direct interface
Date: Thu, 27 Jun 2013 18:37:45 +0200	[thread overview]
Message-ID: <CAJfpegsYPDi2oxt0WKHFrwYBjrk6-SNj_owghtOGxqyVVG45uQ@mail.gmail.com> (raw)
In-Reply-To: <1372350404-10359-4-git-send-email-apw@canonical.com>

Thanks for the patches, Andy.  I already pushed a similar set of fixes
to overlayfs.current (.v18) and to .v17 for the dentry_open() refcount
fix.

On Thu, Jun 27, 2013 at 6:26 PM, Andy Whitcroft <apw@canonical.com> wrote:
> The commit below changed the interface to do_splice_direct, follow that
> change in copy_up:
>
>   commit 7995bd287134f6c8f80d94bebe7396f05a9bc42b
>   Author: Al Viro <viro@zeniv.linux.org.uk>
>   Date:   Thu Jun 20 18:58:36 2013 +0400
>
>     splice: don't pass the address of ->f_pos to methods
>
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
>  fs/overlayfs/copy_up.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
> index eef85e0..8e1b09f 100644
> --- a/fs/overlayfs/copy_up.c
> +++ b/fs/overlayfs/copy_up.c
> @@ -90,9 +90,10 @@ static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len)
>
>         /* FIXME: copy up sparse files efficiently */
>         while (len) {
> -               loff_t offset = new_file->f_pos;
>                 size_t this_len = OVL_COPY_UP_CHUNK_SIZE;
>                 long bytes;
> +               loff_t pos = old_file->f_pos;
> +               loff_t out_pos = new_file->f_pos;
>
>                 if (len < this_len)
>                         this_len = len;
> @@ -102,7 +103,7 @@ static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len)
>                         break;
>                 }
>
> -               bytes = do_splice_direct(old_file, &offset, new_file, this_len,
> +               bytes = do_splice_direct(old_file, &pos, new_file, &out_pos, this_len,


It is interesting how many people end up fixing this the wrong way ;)

Hint: how will the file offsets advance?

Thanks,
Miklos

  reply	other threads:[~2013-06-27 16:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 16:26 [PATCH 0/3] overlayfs fixes for v3.8 and later base Andy Whitcroft
2013-06-27 16:26 ` [PATCH 1/1] overlayfs -- ovl_path_open should not take path reference Andy Whitcroft
2013-06-27 16:26 ` [PATCH 1/2] vfs: export do_splice_direct() to modules -- fix Andy Whitcroft
2013-06-27 16:26 ` [PATCH 2/2] overlayfs -- follow change to do_splice_direct interface Andy Whitcroft
2013-06-27 16:37   ` Miklos Szeredi [this message]
2013-06-27 17:22     ` Andy Whitcroft

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=CAJfpegsYPDi2oxt0WKHFrwYBjrk6-SNj_owghtOGxqyVVG45uQ@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=apw@canonical.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@suse.cz \
    --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 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).