linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: Zach Brown <zab@zabbo.net>
Cc: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/1] Btrfs: fix sparse warning
Date: Mon, 18 Aug 2014 18:53:08 +0200 (CEST)	[thread overview]
Message-ID: <749953430.240415.1408380788296.open-xchange@webmail.nmp.skynet.be> (raw)
In-Reply-To: <20140805213214.GH18659@lenny.home.zabbo.net>



> On 05 August 2014 at 23:32 Zach Brown <zab@zabbo.net> wrote:
>
>
> > > > Hello Zach,
> > > >
> > > >     Here's an untested patch which
> > >
> > > Try testing it.  It's easy with virtualization and xfstests.
> > >
> > > You'll find that sending to a file fails because each individual file
> > > write call that makes up a send starts at offset 0 -- at the start of
> > > the file.
> > >
> > > Getting this right means getting the semantics around updating the send
> > > descriptors f_pos right.  It requires having a bit of a think about send
> > > semantics and f_pos update locking.
> >
> > Thanks for those informations Zach,
> >
> > I've tried btrfs test scripts related to ioctl in xfstests (tests/btrfs/025,
> > 035, 052, 055)
> > but was not able to trigger that problem. Do I have to create another
> > script,
> > use some generic one
> > or maybe use big test/scratch devices ?
>
> No idea, sorry.  Maybe your patch is fine and I'm a dummy.  Maybe you
> didn't test the kernel you thought you were testing.  Maybe the test
> doesn't test what you changed.  You'll have to do some investigating to
> find out.

After checking both kernel and btrfs-progs, it seems file offset is only being
passed through TLV(see send.c/ send_write/
TLV_PUT_U64(BTRFS_SEND_A_FILE_OFFSET). Tell me if I'm wrong but when we do
'btrfs send backup  | btrfs receive backupvolume',
btrfs-progs calls btrfs_ioctl_send emitting several BTRFS_SEND_C_WRITE with
relevant BTRFS_SEND_A_FILE_OFFSET (growing by 48kb). At the other side of | ,
'btrfs receive' executes read_and_process_cmd which does TLV_GET before
s->ops->write. All btrfs interactions being done with | maybe we could simply
replace vfs_write stuff as you suggested and remove sctx->send_off ?

Regards,
Fabian 

>
> - z

      reply	other threads:[~2014-08-18 16:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 19:17 [PATCH 1/1] Btrfs: fix sparse warning Fabian Frederick
2014-07-16 17:20 ` Zach Brown
2014-07-17 18:37   ` Fabian Frederick
2014-07-17 19:01     ` Zach Brown
2014-08-02 12:24       ` Fabian Frederick
2014-08-04 18:31         ` Zach Brown
2014-08-05  9:20           ` Fabian Frederick
2014-08-05 21:32             ` Zach Brown
2014-08-18 16:53               ` Fabian Frederick [this message]

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=749953430.240415.1408380788296.open-xchange@webmail.nmp.skynet.be \
    --to=fabf@skynet.be \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zab@zabbo.net \
    /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).