All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Jiany Wu <wujianyue000@gmail.com>,
	yi.zhang@huawei.com, jack@suse.cz, linux-ext4@vger.kernel.org
Subject: Re: Issue with ext4 filesystem corruption when writing to a file after disk exhaustion
Date: Sat, 12 Jul 2025 10:34:32 -0400	[thread overview]
Message-ID: <20250712143432.GE4040@mit.edu> (raw)
In-Reply-To: <20250712042714.GG2672022@frogsfrogsfrogs>

On Fri, Jul 11, 2025 at 09:27:14PM -0700, Darrick J. Wong wrote:
> 
> Honestly it's really too bad that there's no way for an fs to ask the
> block device how much space it thinks is available, and then teach its
> own statfs method to return min(fs space available, bdev space
> availble).
> 
> Then at least df could report that your 500T ramdisk filesystem on a 4G
> /tmp really only has 4G of space available.

I think it would be better if there was an extra field in the statfs
structure that reported bdev space available, and have it show up
as an extra (optional) column in the df report.

The problem is that bdev space available could be highly variable.
For example, suppose you had a few thousand users all sharing thinly
provisioned space.  If a whole bunch of users suddenly all start using
space, the available space at the storage layer could suddenly
plummet.  And if the available space starts getting low, this might trigger
automated, central fstrims on all of the volumes, causing the free
space to go back up.

Having the free space on a file system as reported by df go up and
down randomly would very likely cause users to get very confused
and upset, especially when it wasn't under their control.  Even for a
single user system the free space in tmpfs could go down suddenly when
some huge process suddenly started, and then go up suddenly when that
process gets OOM-killed.  :-)

     	   	    	      	      	   - Ted

  reply	other threads:[~2025-07-12 14:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11  3:20 Issue with ext4 filesystem corruption when writing to a file after disk exhaustion Jiany Wu
2025-07-11  5:29 ` Theodore Ts'o
2025-07-11  9:56   ` Jiany Wu
2025-07-11 15:40     ` Theodore Ts'o
2025-07-12  4:27       ` Darrick J. Wong
2025-07-12 14:34         ` Theodore Ts'o [this message]
2025-07-14  4:37           ` Jiany Wu
2025-07-14 13:09             ` Theodore Ts'o
2025-07-15  1:27               ` Jiany Wu
2025-07-15  3:42                 ` Theodore Ts'o

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=20250712143432.GE4040@mit.edu \
    --to=tytso@mit.edu \
    --cc=djwong@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=wujianyue000@gmail.com \
    --cc=yi.zhang@huawei.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 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.