Project

General

Profile

Bug #6334

Cannot unlink files when over quota

Added by Simon Klinkert about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2015-10-14
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

It is impossible to remove a file with active holds from a full filesystem:

rm: /mnt/tank/quota/11M not removed: Disc quota exceeded

Reproducer:

#!/bin/bash

FS=tank/quota
FILE=/mnt/$FS/11M

zfs set quota=10M $FS || exit 1
zfs snapshot $FS@snap1 || exit 1
zfs set mountpoint=/mnt/$FS $FS
mkfile 11M $FILE
tail -f $FILE &
rm $FILE && echo "===> rm was successful" && exit 0
pkill tail
echo "===> could not remove the file" 
exit 1

This should be fixed because I'm not able to remove files with NFS4 in that situation because rfs4_op_remove() keeps the file handle open while calling VOP_REMOVE().

I guess we should remove the following condition:

1736    /*
1737     * Mark this transaction as typically resulting in a net free of
1738     * space, unless object removal will be delayed indefinitely
1739     * (due to active holds on the vnode due to the file being open).
1740     */
1741    if (may_delete_now)
1742        dmu_tx_mark_netfree(tx);

http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/zfs_vnops.c#1741

I can’t see why we shouldn’t call dmu_tx_mark_netfree() in every case.


Related issues

Related to illumos gate - Bug #4950: files sometimes can't be removed from a full filesystemClosed2014-07-01

Actions

History

#1

Updated by Simon Klinkert about 4 years ago

  • Related to Bug #4950: files sometimes can't be removed from a full filesystem added
#2

Updated by Chip Schweiss about 4 years ago

I've also encountered this when using refquota. With a refquota, files should always be deletable since removing them will reduce the refer used.

Will this also fix the case when using a refquota?

#3

Updated by Simon Klinkert about 4 years ago

Chip Schweiss wrote:

I've also encountered this when using refquota. With a refquota, files should always be deletable since removing them will reduce the refer used.

Will this also fix the case when using a refquota?

I wasn't able to reproduce it with a refquota. How do you get into that situation?

#4

Updated by Yuri Pankov about 4 years ago

  • Subject changed from Cannot remove files when over quota to Cannot unlink files when over quota
#5

Updated by Yuri Pankov about 4 years ago

Chip Schweiss wrote:

I've also encountered this when using refquota. With a refquota, files should always be deletable since removing them will reduce the refer used.

Will this also fix the case when using a refquota?

Isn't it something that original issue (#4950) was supposed to fix? It did for us.

#6

Updated by Electric Monk about 4 years ago

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

git commit 6575bca01367958c7237253d88e5fa9ef0b1650a

commit  6575bca01367958c7237253d88e5fa9ef0b1650a
Author: Simon Klinkert <simon.klinkert@gmail.com>
Date:   2015-10-30T11:48:18.000Z

    6334 Cannot unlink files when over quota
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF