All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@inwind.it>
To: Chris Murphy <lists@colorremedies.com>
Cc: Boris Burkov <boris@bur.io>, "Apostolos B." <barz621@gmail.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>,
	systemd Mailing List <systemd-devel@lists.freedesktop.org>
Subject: Re: No space left errors on shutdown with systemd-homed /home dir
Date: Sun, 30 Jan 2022 10:27:30 +0100	[thread overview]
Message-ID: <295c62ca-1864-270f-c1b1-3e5cb8fc58dd@inwind.it> (raw)
In-Reply-To: <CAJCQCtQv327wHwsT+j+mq3Fvt2fJwyC7SqFcj_+Ph80OuLKTAw@mail.gmail.com>

On 29/01/2022 19.01, Chris Murphy wrote:
> On Sat, Jan 29, 2022 at 2:53 AM Goffredo Baroncelli <kreijack@libero.it> wrote:
>>
>> I think that for the systemd uses cases (singled device FS), a simpler
>> approach would be:
>>
>>       fstatfs(fd, &sfs)
>>       needed = sfs.f_blocks - sfs.f_bavail;
>>       needed *= sfs.f_bsize
>>
>>       needed = roundup_64(needed, 3*(1024*1024*1024))
>>
>> Comparing the original systemd-homed code, I made the following changes
>> - 1) f_bfree is replaced by f_bavail (which seem to be more consistent to the disk usage; to me it seems to consider also the metadata chunk allocation)
>> - 2) the needing value is rounded up of 3GB in order to consider a further 1 data chunk and 2 metadata chunk (DUP))
>>
>> Comments ?
> 
> I'm still wondering if such a significant shrink is even indicated, in
> lieu of trim. Isn't it sufficient to just trim on logout, thus
> returning unused blocks to the underlying filesystem? 

I agree with you. In Fedora 35, and the default is ext4+luks+trim
which provides the same results. However I remember that in the past the default
was btrfs+luks+shrunk. I think that something is changed i.

However, I want to provide do the systemd folks a suggestion ho change the code.
Even a warning like: "it doesn't work that because this, please drop it"
would be sufficient.

> And then do an
> fs resize (shrink or grow) as needed on login, so that the user home
> shows ~80% of the free space in the underlying file system?
> 
> homework-luks.c:3407:                                /* Before we
> shrink, let's trim the file system, so that we need less space on disk
> during the shrinking */
> 
> 
> 


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2022-01-30  9:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 17:46 No space left errors on shutdown with systemd-homed /home dir Apostolos B.
2022-01-26 21:50 ` Boris Burkov
2022-01-26 22:07   ` Apostolos B.
2022-01-26 23:19     ` Boris Burkov
2022-01-26 23:29       ` Apostolos B.
2022-01-27  7:59         ` Wang Yugui
2022-01-27  8:51           ` Wang Yugui
2022-01-27 19:13         ` Goffredo Baroncelli
2022-01-27 20:48       ` Chris Murphy
2022-01-29  9:53         ` Goffredo Baroncelli
2022-01-29 18:01           ` Chris Murphy
2022-01-30  9:27             ` Goffredo Baroncelli [this message]
2022-01-31  9:41               ` Colin Guthrie
2022-02-01 19:55                 ` Neal Gompa
2022-05-31 12:44                   ` Colin Guthrie
2022-05-31 18:12                     ` Goffredo Baroncelli
2022-06-01  9:36                       ` Colin Guthrie
2022-07-23 19:09                         ` Chris Murphy
2022-02-01  4:26           ` Zygo Blaxell
2022-07-23 19:26             ` Chris Murphy

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=295c62ca-1864-270f-c1b1-3e5cb8fc58dd@inwind.it \
    --to=kreijack@inwind.it \
    --cc=barz621@gmail.com \
    --cc=boris@bur.io \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=systemd-devel@lists.freedesktop.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 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.