Project

General

Profile

Bug #4950

files sometimes can't be removed from a full filesystem

Added by Matthew Ahrens about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
zfs - Zettabyte File System
Start date:
2014-07-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

In some full filesystems, "rm" of even small files works just fine. But in
other full filesystems, "rm" even of large files can fail with ENOSPC.

The problem occurs when the unlinked ZAP object (which contains the list of
files which have a link count of zero but which haven't been removed from disk
yet, e.g. because the file is still open) is a fat ZAP (because at some point
it had more than ~2000 entries). In this case, our space estimation
(dmu_tx_hold_zap()) doesn't determine exactly which blocks of the fat zap will
be modified, so it has to assume that those blocks might be part of a snapshot,
and therefore won't be freed.

The space estimation code is fairly fragile, so a robust solution is to
explicitly mark file removal transactions as "presumed to result in a net free
of space". This would let them ignore refquotas, and use half of the pool
space overhead (dsl_pool_adjustedsize()).

The problem can be seen when the estimated space to "alloc" is more than the
estimated space to "free", as shown by the following dtrace command:

dtrace -n 'dsl_dir_tempreserve_space:entry{printf("alloc=%uK free=%uK",
args2>>10, args3>>10)}' -c 'rm f'


Related issues

Related to illumos gate - Bug #6334: Cannot unlink files when over quotaClosed2015-10-14

Actions

History

#1

Updated by Electric Monk about 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 4bb73804952172060c9efb163b89c17f56804fe8

commit  4bb73804952172060c9efb163b89c17f56804fe8
Author: Matthew Ahrens <mahrens@delphix.com>
Date:   2014-07-07T19:49:36.000Z

    4950 files sometimes can't be removed from a full filesystem
    Reviewed by: Adam Leventhal <adam.leventhal@delphix.com>
    Reviewed by: George Wilson <george.wilson@delphix.com>
    Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
    Reviewed by: Boris Protopopov <bprotopopov@hotmail.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

#2

Updated by Simon Klinkert almost 4 years ago

  • Related to Bug #6334: Cannot unlink files when over quota added

Also available in: Atom PDF