* clone syscall fails for bedup-deduplicated files
@ 2013-12-07 21:31 Pascal Germroth
2013-12-11 19:04 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Pascal Germroth @ 2013-12-07 21:31 UTC (permalink / raw)
To: linux-btrfs
Hi,
Running a 3.8 kernel I've been using bedup to deduplicate some files, for example two identical 500MB files A & B now share data chunks.
Running a 3.11 kernel, I wanted to clone some more files, but those previously deduplicated by bedup don't work, for example: `cp --reflink A C`:
open("A", O_WRONLY|O_TRUNC) = 4
fstat(4, {st_mode=S_IFREG|0775, st_size=0, ...}) = 0
ioctl(4, BTRFS_IOC_CLONE, 0x3) = -1 EINVAL (Invalid argument)
But I can clone a duplicate of the file just fine: `cp A D; cp --reflink D E` copies A to D and then clones D to E.
So I guess the way bedup deduplicated A broke the btrfs structure in a way that forbids further cloning, but a newly generated file like D can still be cloned.
How could bedup break this, did it manipulate the structures directly in 3.8 without the syscall and corrupt something? How can I repair this? Defragmenting A had no effect.
(If you answer, please CC me directly, I'm not currently subscribed to the list)
Cheers,
--
Pascal Germroth
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: clone syscall fails for bedup-deduplicated files
2013-12-07 21:31 clone syscall fails for bedup-deduplicated files Pascal Germroth
@ 2013-12-11 19:04 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2013-12-11 19:04 UTC (permalink / raw)
To: Pascal Germroth; +Cc: linux-btrfs
On Sat, Dec 07, 2013 at 10:31:30PM +0100, Pascal Germroth wrote:
> Running a 3.8 kernel I've been using bedup to deduplicate some files,
> for example two identical 500MB files A & B now share data chunks.
> Running a 3.11 kernel, I wanted to clone some more files, but those
> previously deduplicated by bedup don't work, for example: `cp
> --reflink A C`:
>
> open("A", O_WRONLY|O_TRUNC) = 4
> fstat(4, {st_mode=S_IFREG|0775, st_size=0, ...}) = 0
> ioctl(4, BTRFS_IOC_CLONE, 0x3) = -1 EINVAL (Invalid argument)
This can fail eg when the files have different status wrt checksums,
when one of the files is nocow or created under nodatasum mount (there's
no way to create nodatasum file otherwise, unlike nodatacow).
Look at lsattr output if the files have the C attribute.
david
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-11 19:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-07 21:31 clone syscall fails for bedup-deduplicated files Pascal Germroth
2013-12-11 19:04 ` David Sterba
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).