All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs receive eats CoW attributes
@ 2021-01-05  2:38 Cerem Cem ASLAN
  2021-01-05  3:00 ` Chris Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Cerem Cem ASLAN @ 2021-01-05  2:38 UTC (permalink / raw)
  To: Btrfs BTRFS

I need my backups exactly same data, including the file attributes.
Apparently "btrfs receive" ignores the CoW attribute. Here is the
reproduction:

btrfs sub create ./a
mkdir a/b
chattr +C a/b
echo "hello" > a/b/file
btrfs sub snap -r ./a ./a.ro
mkdir x
btrfs send a.ro | btrfs receive x
lsattr a.ro
lsattr x/a.ro

Result is:

# lsattr a.ro
---------------C--- a.ro/b
# lsattr x/a.ro
------------------- x/a.ro/b

Expected: x/a.ro/b folder should have CoW disabled (same as a.ro/b folder)

How can I workaround this issue in order to have correct attributes in
my backups?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs receive eats CoW attributes
  2021-01-05  2:38 btrfs receive eats CoW attributes Cerem Cem ASLAN
@ 2021-01-05  3:00 ` Chris Murphy
  2021-01-09 14:13   ` Cerem Cem ASLAN
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Murphy @ 2021-01-05  3:00 UTC (permalink / raw)
  To: Cerem Cem ASLAN; +Cc: Btrfs BTRFS

On Mon, Jan 4, 2021 at 7:42 PM Cerem Cem ASLAN <ceremcem@ceremcem.net> wrote:
>
> I need my backups exactly same data, including the file attributes.
> Apparently "btrfs receive" ignores the CoW attribute. Here is the
> reproduction:
>
> btrfs sub create ./a
> mkdir a/b
> chattr +C a/b
> echo "hello" > a/b/file
> btrfs sub snap -r ./a ./a.ro
> mkdir x
> btrfs send a.ro | btrfs receive x
> lsattr a.ro
> lsattr x/a.ro
>
> Result is:
>
> # lsattr a.ro
> ---------------C--- a.ro/b
> # lsattr x/a.ro
> ------------------- x/a.ro/b
>
> Expected: x/a.ro/b folder should have CoW disabled (same as a.ro/b folder)
>
> How can I workaround this issue in order to have correct attributes in
> my backups?

It's the exact opposite issue with chattr +c (or btrfs property set
compression), you can't shake it off :)

I think we might need 'btrfs receive' to gain a new flag that filters
some or all of these? And the filter would be something like
--exclude=$1,$2,$3 and --exclude=all

I have no strong opinion on what should be the default. But I think
probably the default should be "do not preserve any" because these
features aren't mkfs or mount time defaults, so I'd make preservation
explicitly opt in like they were on the original file system.


-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: btrfs receive eats CoW attributes
  2021-01-05  3:00 ` Chris Murphy
@ 2021-01-09 14:13   ` Cerem Cem ASLAN
  0 siblings, 0 replies; 3+ messages in thread
From: Cerem Cem ASLAN @ 2021-01-09 14:13 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Btrfs BTRFS

I agree that the "--exclude" filter is the most necessary feature for
'btrfs send' but I guess there must be some kind of technical issues
which forced the author use "exclude by subvolume" approach.

I guess any explicit settings should be transferred by default or
there would be no default behavior and user should be required for an
action explicitly.

There isn't a workaround till that day, is there?

Chris Murphy <lists@colorremedies.com>, 5 Oca 2021 Sal, 06:00
tarihinde şunu yazdı:
>
> On Mon, Jan 4, 2021 at 7:42 PM Cerem Cem ASLAN <ceremcem@ceremcem.net> wrote:
> >
> > I need my backups exactly same data, including the file attributes.
> > Apparently "btrfs receive" ignores the CoW attribute. Here is the
> > reproduction:
> >
> > btrfs sub create ./a
> > mkdir a/b
> > chattr +C a/b
> > echo "hello" > a/b/file
> > btrfs sub snap -r ./a ./a.ro
> > mkdir x
> > btrfs send a.ro | btrfs receive x
> > lsattr a.ro
> > lsattr x/a.ro
> >
> > Result is:
> >
> > # lsattr a.ro
> > ---------------C--- a.ro/b
> > # lsattr x/a.ro
> > ------------------- x/a.ro/b
> >
> > Expected: x/a.ro/b folder should have CoW disabled (same as a.ro/b folder)
> >
> > How can I workaround this issue in order to have correct attributes in
> > my backups?
>
> It's the exact opposite issue with chattr +c (or btrfs property set
> compression), you can't shake it off :)
>
> I think we might need 'btrfs receive' to gain a new flag that filters
> some or all of these? And the filter would be something like
> --exclude=$1,$2,$3 and --exclude=all
>
> I have no strong opinion on what should be the default. But I think
> probably the default should be "do not preserve any" because these
> features aren't mkfs or mount time defaults, so I'd make preservation
> explicitly opt in like they were on the original file system.
>
>
> --
> Chris Murphy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-09 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05  2:38 btrfs receive eats CoW attributes Cerem Cem ASLAN
2021-01-05  3:00 ` Chris Murphy
2021-01-09 14:13   ` Cerem Cem ASLAN

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.