Re: btrfs fi df output is not updated in a timely manner after subvolumes have been deleted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2014-05-20 at 14:46 +0100, Astro Xe wrote:
> On my box, the "used" value in the output of "btrfs filesystem df" is
> not updated in a timely manner, after that one or more subvolumes have
> been deleted. I need to execute "btrfs filesystem sync", in order to
> update the value. Could someone fix this, please? I suspect the cause
> is that subvolumes are marked immediately as deleted, but cleanedup at
> a later time, is this right?

Yes, this is exactly true. After you delete a subvolume on btrfs, the
"btrfs-cleaner" kernel process has to before the space is actually freed
up. This process goes through all the contents of the subvolume,
determines which files aren't being shared with other subvolumes or
reflinks, and frees the space for those.

The problem is that it doesn't make sense to update the free space
immediately - and it's not really possible to do it either.

It doesn't make sense to update the free space immediately, because the
space isn't actually usable immediately. Before you can create new files
that use this space, you have to wait for the cleaner process to run and
delete the old files.

It's not really possible to update the free space immediately, because
the filesystem doesn't actually know how much space would be freed! In
order to determine this number, the filesystem has to check all the
files in the subvolume - which is what btrfs-cleaner is doing.

-- 
Calvin Walton <calvin.walton@xxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux