linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arvin Schnell <aschnell@suse.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: Snapper snapshot comparison algorithm - send/receive questions
Date: Mon, 3 Dec 2012 12:35:47 +0100	[thread overview]
Message-ID: <20121203113547.GA19321@suse.de> (raw)
In-Reply-To: <CAFhuFEdxHxdiAutfxxsQ9i0OJj_CfRwWD-0LuhvoJYGHkTsG4A@mail.gmail.com>

On Sat, Dec 01, 2012 at 01:24:20PM +0530, nafisa mandliwala wrote:

> I needed help with understanding the snapshot comparison algorithm
> that snapper uses and its shortcomings. From reading the code, what I
> understood is that it does a block by block compare. I'm not very sure
> if that's the best way to go about it. Also, since the send receive
> code is still in development stages, is there a scope to add more
> functionality to it?

Mainly snapper does a directory traversal and a block-by-block
comparison of files which is indeed a inefficient comparison
algorithm.

I already had a look at using the new send/receive ioctl to
improve the comparison and have a few question:

1. snapper only needs to know that a file has changed but the
   send stream also contains the new content which might has to
   be read from disk.

   Mark Fasheh has made a patch for a flag for the send ioctl to
   not include the content (don't know if he posted it here since
   I was kicked of the list twice). With no write commands in the
   stream how can I detect a file content change? Currently there
   seems to be a truncate after the write but is that guaranteed?

   Btw: There are many apparently useless truncates, e.g. after a
   chmod. What are these good for?

2. Is it possible to add a ioctl for send that takes open
   file-descriptors for parent_root and clone_sources? Otherwise
   it's insecure to use from snapper (which has root privileges
   and sometimes operates in directories users can modify). Such
   a ioctl would also reduce the number of btrfs related
   functions needed.

3. Overall lots of functions are needed to use the
   send/receive. Are there any plans to create a btrfs-library
   that contains the required functions
   e.g. btrfs_read_and_process_send_stream, subvol_uuid_search
   and tree_search?

Regards,
  Arvin

-- 
Arvin Schnell, <aschnell@suse.de>
Senior Software Engineer, Research & Development
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5
90409 Nürnberg
Germany

  parent reply	other threads:[~2012-12-03 11:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-01  7:54 Snapper snapshot comparison algorithm nafisa mandliwala
2012-12-01 19:00 ` Alex Lyakas
     [not found]   ` <CANTVtNqzGmK2fb3EEXtjAanNBGxBCN2T44wnMw9xLTYSyPV3vA@mail.gmail.com>
2012-12-09  9:14     ` Alex Lyakas
     [not found]       ` <CANTVtNqB_C+srL9DsL2b7QC1rUT4m5-6RHR6CqQbajQm2NCy0w@mail.gmail.com>
2012-12-17  9:05         ` Alex Lyakas
     [not found]           ` <CAFhuFEeV-NpkGTdV+yh0K3vWj-1ntQNSkwtg1r=SyZ04dSkHaA@mail.gmail.com>
     [not found]             ` <CAFhuFEc9YRhP1aN_1-JG7VRfC0_pNA2nwK7-nzR6kj7bbNoX4g@mail.gmail.com>
     [not found]               ` <CAFhuFEc==AeTi8cjHHCZDiP-xN6XLJDJmW4pVtnhr2rcWVEoag@mail.gmail.com>
2012-12-31  9:21                 ` Alex Lyakas
2012-12-31 19:02                   ` Alex Lyakas
     [not found]                 ` <CAFhuFEeWGQML_qp-B1f6DSnDMaSaRyKCkDPDULaxWgdsBC1GzA@mail.gmail.com>
2012-12-31  9:36                   ` Alex Lyakas
2012-12-03 11:35 ` Arvin Schnell [this message]
2012-12-09  9:00   ` Snapper snapshot comparison algorithm - send/receive questions Alex Lyakas

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=20121203113547.GA19321@suse.de \
    --to=aschnell@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    /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).