From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: exclusive subvolume space missing
Date: Sat, 16 Dec 2017 03:21:04 +0000 (UTC) [thread overview]
Message-ID: <pan$daba3$1a46428e$8d941aa3$5ef253e8@cox.net> (raw)
In-Reply-To: 20171215082214.GA13892@polanet.pl
Tomasz Pala posted on Fri, 15 Dec 2017 09:22:14 +0100 as excerpted:
> I wonder how this one db-library behaves:
>
> $ find . -name \*.sqlite | xargs ls -gGhS | head -n1
> -rw-r--r-- 1 15M 2017-12-08 12:14
> ./.mozilla/firefox/vni9ojqi.default/extension-data/ublock0.sqlite
>
> $ ~/fiemap ./.mozilla/firefox/*.default/extension-data/ublock0.sqlite |
> head -n1
> File ./.mozilla/firefox/vni9ojqi.default/extension-data/ublock0.sqlite
> has 128 extents:
>
>
> At least every $HOME/{.{,c}cache,tmp} should be +C...
Many admins will put tmp, and sometimes cache or selected parts of it, on
tmpfs anyway... thereby both automatically clearing it on reboot, and
allowing enforced size control as necessary.
>> And if possible, use nocow for this file.
>
> Actually, this should be officially advised to use +C for entire /var
> tree and every other tree that might be exposed for hostile write
> patterns, like /home or /tmp (if held on btrfs).
>
> I'd say, that from security point of view the nocow should be default,
> unless specified for mount or specific file... Currently, if I mount
> with nocow, there is no way to whitelist trusted users or secure
> location, and until btrfs-specific options could be handled per
> subvolume, there is really no alternative.
Nocow disables many reasons people run btrfs in the first place,
including checksumming and damage-detection, with auto-repair from other
copies where available (raid1/10 and dup modes primarily), as well as
btrfs transparent compression, for users using that. Additionally,
snapshotting, another feature people use btrfs for, turns nocow into cow1
(cow the first time a block is written after a snapshot), since
snapshotting locks down the previous extent in ordered to maintain the
snapshotted reference.
And given that any user can create a snapshot any time they want (even if
you lock down the btrfs executable, if they're malevolent users and not
locked to only running specifically whitelisted executables, they can
always get a copy of the executable elsewhere), and /home or individual
user subvols may well be auto-snapshotted already, setting nocow isn't
likely to be of much security value at all.
So nocow is, as one regular wrote, most useful for "this really should go
on something other than btrfs, but I'm too lazy to set it up that way and
I'm already on btrfs, so the nocow band-aid is all I got. And yes, I try
using my screwdriver as a hammer too, because that's what I have there
too!"
In that sort of case, just use some other filesystem more appropriate to
the use-case, and you won't have to worry about btrfs issues, cow-
triggered or otherwise, in the first place.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
next prev parent reply other threads:[~2017-12-16 3:21 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-01 16:15 exclusive subvolume space missing Tomasz Pala
2017-12-01 21:27 ` Duncan
2017-12-01 21:36 ` Hugo Mills
2017-12-02 0:53 ` Tomasz Pala
2017-12-02 1:05 ` Qu Wenruo
2017-12-02 1:43 ` Tomasz Pala
2017-12-02 2:17 ` Qu Wenruo
2017-12-02 2:56 ` Duncan
2017-12-02 16:28 ` Tomasz Pala
2017-12-02 17:18 ` Tomasz Pala
2017-12-03 1:45 ` Duncan
2017-12-03 10:47 ` Adam Borowski
2017-12-04 5:11 ` Chris Murphy
2017-12-10 10:49 ` Tomasz Pala
2017-12-04 4:58 ` Chris Murphy
2017-12-02 0:27 ` Qu Wenruo
2017-12-02 1:23 ` Tomasz Pala
2017-12-02 1:47 ` Qu Wenruo
2017-12-02 2:21 ` Tomasz Pala
2017-12-02 2:35 ` Qu Wenruo
2017-12-02 9:33 ` Tomasz Pala
2017-12-04 0:34 ` Qu Wenruo
2017-12-10 11:27 ` Tomasz Pala
2017-12-10 15:49 ` Tomasz Pala
2017-12-10 23:44 ` Qu Wenruo
2017-12-11 0:24 ` Qu Wenruo
2017-12-11 11:40 ` Tomasz Pala
2017-12-12 0:50 ` Qu Wenruo
2017-12-15 8:22 ` Tomasz Pala
2017-12-16 3:21 ` Duncan [this message]
2017-12-05 18:47 ` How exclusive in parent qgroup is computed? (was: Re: exclusive subvolume space missing) Andrei Borzenkov
2017-12-05 23:57 ` How exclusive in parent qgroup is computed? Qu Wenruo
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='pan$daba3$1a46428e$8d941aa3$5ef253e8@cox.net' \
--to=1i5t5.duncan@cox.net \
--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).