linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: Andrei Borzenkov <arvidjaar@gmail.com>,
	Chris Murphy <lists@colorremedies.com>,
	Andrii Zymohliad <azymohliad@protonmail.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [Help] Can't login to my systemd-homed user account due to fallocate failure
Date: Mon, 24 Aug 2020 19:42:12 +0200	[thread overview]
Message-ID: <b0d0784a-03b5-c212-f4a1-f09ff487e355@libero.it> (raw)
In-Reply-To: <2aed3d08-94fe-f2ef-e858-31913a8ecfee@gmail.com>

On 8/24/20 5:23 PM, Andrei Borzenkov wrote:
> 24.08.2020 10:13, Chris Murphy пишет:
>>
>> I think we've got a pretty good idea what's going on. The current work
>> around in your case will be to use the --luks-discard=true option when
>> activating. This will avoid the fallocate step. But the question
>> remains why the fallocate fails. I suspect it has something to do with
>> shared extents.
> 
> 
> Actually I see the same behavior without any shared extent at all.
> fallocate attempts to allocate full file size, not just additional
> unallocated space:

I don't remember if at the time it was reached a conclusion, but this topic was already discussed in the past:

https://lore.kernel.org/linux-btrfs/798a9077-bcbd-076c-a458-3403010ce8ac@libero.it/

I think that this information should be forwarded back to the systemd mailing list...

Anyway IMHO a failing fallocate for a small file is a reasonable failure.
However I am not convinced that this is still true for a filesystem image (like the systemd-homed
case is). In this case it is reasonable to thinking the image as sparse image as a way of
over-provisioning.
However it is true that not all the stack (btrfs <-> loopback <-> luks <-> btrfs) is able to manage
a case where there is no space, so fallocat'ing may be the least worst scenario...

> 
> tw:/mnt # truncate -s $[112*5]M src/file
> tw:/mnt # dd if=/dev/urandom of=src/file conv=notrunc,block,sync bs=112M
> count=20+2 records in
> 2+0 records out
> 234881024 bytes (235 MB, 224 MiB) copied, 1.53186 s, 153 MB/s
> tw:/mnt # sync
> tw:/mnt # btrfs fi us /mnt
> Overall:
>      Device size:		   1.00GiB
>      Device allocated:		 356.00MiB
>      Device unallocated:		 668.00MiB
>      Device missing:		     0.00B
>      Used:			 224.59MiB
>      Free (estimated):		 787.81MiB	(min: 787.81MiB)
>      Data ratio:			      1.00
>      Metadata ratio:		      1.00
>      Global reserve:		   3.25MiB	(used: 0.00B)
>      Multiple profiles:		        no
> 
> Data,single: Size:344.00MiB, Used:224.19MiB (65.17%)
>     /dev/vdc	 344.00MiB
> 
> Metadata,single: Size:8.00MiB, Used:400.00KiB (4.88%)
>     /dev/vdc	   8.00MiB
> 
> System,single: Size:4.00MiB, Used:16.00KiB (0.39%)
>     /dev/vdc	   4.00MiB
> 
> Unallocated:
>     /dev/vdc	 668.00MiB
> tw:/mnt # fallocate -l $[112*5]M -n src/file
> tw:/mnt # sync
> tw:/mnt # btrfs fi us /mnt
> Overall:
>      Device size:		   1.00GiB
>      Device allocated:		 916.00MiB
>      Device unallocated:		 108.00MiB
>      Device missing:		     0.00B
>      Used:			 560.78MiB
>      Free (estimated):		 451.62MiB	(min: 451.62MiB)
>      Data ratio:			      1.00
>      Metadata ratio:		      1.00
>      Global reserve:		   3.25MiB	(used: 0.00B)
>      Multiple profiles:		        no
> 
> Data,single: Size:904.00MiB, Used:560.38MiB (61.99%)
>     /dev/vdc	 904.00MiB
> 
> Metadata,single: Size:8.00MiB, Used:400.00KiB (4.88%)
>     /dev/vdc	   8.00MiB
> 
> System,single: Size:4.00MiB, Used:16.00KiB (0.39%)
>     /dev/vdc	   4.00MiB
> 
> Unallocated:
>     /dev/vdc	 108.00MiB
> tw:/mnt # btrfs fi du src/file
>       Total   Exclusive  Set shared  Filename
>   560.00MiB   560.00MiB       0.00B  src/file
> tw:/mnt # uname -a
> Linux tw.0.2.15 5.8.0-1-default #1 SMP Tue Aug 4 07:30:59 UTC 2020
> (9bc0044) x86_64 x86_64 x86_64 GNU/Linux
> tw:/mnt #
> 


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

      reply	other threads:[~2020-08-24 17:42 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-23 15:31 [Help] Can't login to my systemd-homed user account due to fallocate failure Andrii Zymohliad
2020-08-23 15:37 ` Hugo Mills
2020-08-23 16:21   ` Andrei Borzenkov
2020-08-23 16:55     ` Andrii Zymohliad
2020-08-23 18:16       ` Andrei Borzenkov
2020-08-23 18:49         ` Andrii Zymohliad
2020-08-24  3:01           ` Chris Murphy
2020-08-24  2:23   ` Chris Murphy
2020-08-24  2:50 ` Chris Murphy
2020-08-24  6:11   ` Andrii Zymohliad
2020-08-24  7:13     ` Chris Murphy
2020-08-24  7:25       ` Andrii Zymohliad
2020-08-24  8:28         ` Andrii Zymohliad
2020-08-24  8:32           ` Andrii Zymohliad
2020-08-24 18:51             ` Chris Murphy
2020-08-25  7:22               ` Andrii Zymohliad
2020-08-25 19:05                 ` Chris Murphy
2020-08-25 20:47                   ` Andrii Zymohliad
2020-08-25 22:34                     ` Chris Murphy
2020-08-26 13:37                       ` Andrii Zymohliad
2020-08-26 13:40                         ` Andrii Zymohliad
2020-08-26 19:06                           ` Chris Murphy
     [not found]                             ` <dHPyoaNUuxoqxJjpSUjcxZvk21ew2ObKWFFhX0efJKBqjG8m27px3mPupviQuM3HYQDEcYQGFQ9jOprBuAX4x1Em3oVOyDl6EhKwEJSiuXs=@protonmail.com>
2020-08-26 19:15                               ` Chris Murphy
2020-08-26 19:57                                 ` Andrii Zymohliad
2020-08-26 21:06                                   ` Chris Murphy
2020-08-26 21:08                                     ` Chris Murphy
2020-08-26 21:14                                       ` Chris Murphy
2020-08-27  6:48                                         ` Andrii Zymohliad
2020-09-01 15:01                                           ` Chris Murphy
2020-09-01 17:06                                             ` Andrii Zymohliad
2020-09-01 17:22                                               ` Chris Murphy
2020-09-01 17:27                                                 ` Andrii Zymohliad
2020-09-01 17:31                                                   ` Andrii Zymohliad
2020-09-01 20:45                                                     ` Chris Murphy
2020-09-02 16:35                                                     ` Chris Murphy
2020-08-27  5:39                             ` Andrei Borzenkov
2020-08-24 15:23       ` Andrei Borzenkov
2020-08-24 17:42         ` Goffredo Baroncelli [this message]
     [not found] <bdJVxLiFr=5FPyQSXRUbZJfFW=5FjAjsGgoMetqPHJMbg-hdy54Xt=5FZHhRetmnJ6cJ99eBlcX76wy-AvWwV715c3YndkxneSlod11P1hlaADx0s=3D@protonmail.com>
     [not found] ` <CAJCQCtTC2yi4HRqg6fkMrxw33TVSBh=5FyAKtnX-Z1-nXSVjBW7w@mail.gmail.com>
     [not found]   ` <Yy8-04dbNru1LWPcNZ9UxsagH1b0KNsGn7tDEnxVOqS812IqGiwl37dj4rxAh05gEP8QoNJ5F=5FEa6CZ8iZgvnupuq5Qzc38gl69MceWMc9s=3D@protonmail.com>
     [not found]     ` <CAJCQCtSqe=5FoqRZWYP7iLJcGQnzZkC4vmoYVTm=5F9RPb8eb0-E6Q@mail.gmail.com>
     [not found]       ` <BfU9s11rmWxGNQdKqifkB1JKOJcgqAN49OZdV4LAOgo1W2AguRebwCPVosOiMVjMTzuSmsk=5FEfbkl02s31niRqtCS67WJ9S7=5Fs4jiK9afeA=3D@protonmail.com>
     [not found]         ` <E212ihR5U8HVCyaalepkxQUX3wOj6IXd1yUFHj-PFFtyU7ma-A49vmB8QwfQG5gUVo2nCMbVpPo7C2ccooRO0ExVrIbdLP9sBpnjMOcefHo=3D@protonmail.com>
     [not found]           ` <lyGE8gPEf9cUEMJceWoJWD=5Fibk4viZXU0yG5VzbNe9yueGbkcnl1FkJrFZZufhWd5y2vNOgAwfYSpJ4Gia5Tow4wdmQXiGuETdyuNmnemJY=3D@protonmail.com>
     [not found]             ` <CAJCQCtR3gbJxJn24qyDfHWh9kQG7BSC=3DNnoGHmRKPnaQ+P7yyg@mail.gmail.com>
     [not found]               ` <8oT9s0Jlzpgp2ctPAXOixSR03oOiPXaitR0AiOkNdBsYHwjPMfjK7CoVAPXuvj71hiUTH-fKoSevAM-To8iSPPBvGRvZeBkU0Nd1=5F NPonyU=3D?= =?us-ascii?Q?@protonmail.com>
     [not found]                 ` <CAJCQCtQH3h=3DNNr6PX3HZp7SbkgqZtNNdihi4aBMFvx+DN79XeA@mail.gmail.com>
     [not found]                   ` <6LDov933WqF3kLH8jtkEh-pfK6pRe0o6-Y9l3NcO2mVhswDL7rhbHyda71OnztoJKfgqqQT9jj1Ba52lz=5FugNFmmRtzN33BlSa5pCvds0F8=3D@protonmail.com>
     [not found]                     ` <CAJCQCtQDt=3Dx7WCX7KhWz=5FpPn4yB1YdZm9jN29jRuQ DFy=3DZTO?= =?us-ascii?Q?jA@mail.gmail.com>

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=b0d0784a-03b5-c212-f4a1-f09ff487e355@libero.it \
    --to=kreijack@libero.it \
    --cc=arvidjaar@gmail.com \
    --cc=azymohliad@protonmail.com \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    /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).