* nocow and compression
@ 2014-10-27 12:56 Marc Dietrich
2014-10-27 12:59 ` Swâmi Petaramesh
0 siblings, 1 reply; 4+ messages in thread
From: Marc Dietrich @ 2014-10-27 12:56 UTC (permalink / raw)
To: linux-btrfs
Hi,
I created a filesystem and mounted it with compress-force=lzo. Then I did:
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 100M 4.1M 96M 5% /mnt
# yes "Hello World" | dd of=/mnt/test iflag=fullblock bs=1M count=20
status=none
yes: standard output: Broken pipe
yes: write error
# sync; ls -l ; df -h .
total 20480
-rw-r--r-- 1 root root 20971520 Oct 27 13:48 test
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 100M 4.7M 96M 5% /mnt
so far so good ...
# touch test2; chattr +C test2
# dd if=test of=test2 conv=notrunc bs=1M iflag=fullblock oflag=append
status=none
# sync; ls -l ; df -h .
total 40960
-rw-r--r-- 1 root root 20971520 Oct 27 13:51 test
-rw-r--r-- 1 root root 20971520 Oct 27 13:51 test2
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 100M 25M 76M 25% /mnt
oops, no compression.
Is this intended?
Marc
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nocow and compression
2014-10-27 12:56 nocow and compression Marc Dietrich
@ 2014-10-27 12:59 ` Swâmi Petaramesh
2014-10-27 13:06 ` Marc Dietrich
0 siblings, 1 reply; 4+ messages in thread
From: Swâmi Petaramesh @ 2014-10-27 12:59 UTC (permalink / raw)
To: Marc Dietrich; +Cc: linux-btrfs
Le lundi 27 octobre 2014, 13:56:07 Marc Dietrich a écrit :
> oops, no compression.
> Is this intended?
« Compression does not work for NOCOW files » is clearly stated in
https://btrfs.wiki.kernel.org/index.php/Compression#How_does_compression_interact_with_direct_IO_or_COW.3F
Kind regards.
--
Swâmi Petaramesh <swami@petaramesh.org> http://petaramesh.org PGP 9076E32E
Quand les doutes sont balayés, la foi véritable réapparaît, confirmée et
redressée. Plus rien ne demeure, rien qu'il faille se remémorer.
-- Seng-Ts'an, Troisième Patriarche, Le Sin-sin-ming (VIIe s)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nocow and compression
2014-10-27 12:59 ` Swâmi Petaramesh
@ 2014-10-27 13:06 ` Marc Dietrich
2014-10-27 13:10 ` Swâmi Petaramesh
0 siblings, 1 reply; 4+ messages in thread
From: Marc Dietrich @ 2014-10-27 13:06 UTC (permalink / raw)
To: Swâmi Petaramesh; +Cc: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 426 bytes --]
Am Montag, 27. Oktober 2014, 13:59:24 schrieb Swâmi Petaramesh:
> Le lundi 27 octobre 2014, 13:56:07 Marc Dietrich a écrit :
> > oops, no compression.
> > Is this intended?
>
> « Compression does not work for NOCOW files » is clearly stated in
>
> https://btrfs.wiki.kernel.org/index.php/Compression#How_does_compression_int
> eract_with_direct_IO_or_COW.3F
ah, sorry, I somehow overlooked this.
Thanks
Marc
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nocow and compression
2014-10-27 13:06 ` Marc Dietrich
@ 2014-10-27 13:10 ` Swâmi Petaramesh
0 siblings, 0 replies; 4+ messages in thread
From: Swâmi Petaramesh @ 2014-10-27 13:10 UTC (permalink / raw)
To: Marc Dietrich; +Cc: linux-btrfs
As far as I understood, "NOCOW" means that modified parts of files be rewritten
into place, whereas compression causes compressed blocks of variable sizes to
be created (depending upon their compression ratio). Changing a block in a file
will most probably change its compressed size, and then you see why it cannot
be rewritten into place...
Somebody correct me if I'm wrong ;-)
Le lundi 27 octobre 2014, 14:06:36 Marc Dietrich a écrit :
> >
> > « Compression does not work for NOCOW files » is clearly stated in
> >
> > https://btrfs.wiki.kernel.org/index.php/Compression#How_does_compression_i
> > nt eract_with_direct_IO_or_COW.3F
>
> ah, sorry, I somehow overlooked this.
>
> Thanks
>
> Marc
--
Swâmi Petaramesh <swami@petaramesh.org> http://petaramesh.org PGP 9076E32E
Tout être manifesté est là pour embaumer, pour exprimer la Présence.
-- Jean-Marc Mantel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-27 13:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27 12:56 nocow and compression Marc Dietrich
2014-10-27 12:59 ` Swâmi Petaramesh
2014-10-27 13:06 ` Marc Dietrich
2014-10-27 13:10 ` Swâmi Petaramesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox