-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4951 ZFS administrative commands should use reserved space, not fail …
…with ENOSPC Reviewed by: John Kennedy <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Garrett D'Amore <[email protected]>
- Loading branch information
Showing
26 changed files
with
258 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
usr/src/test/zfs-tests/tests/functional/no_space/enospc_002_pos.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
# | ||
# Copyright (c) 2014 by Delphix. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/no_space/enospc.cfg | ||
|
||
# | ||
# DESCRIPTION: | ||
# After filling a filesystem, certain zfs commands are allowed. | ||
# | ||
|
||
verify_runnable "both" | ||
|
||
log_assert "ENOSPC is returned when file system is full." | ||
sync | ||
log_must $ZFS set compression=off $TESTPOOL/$TESTFS | ||
log_must $ZFS snapshot $TESTPOOL/$TESTFS@snap | ||
|
||
log_note "Writing file: $TESTFILE0 until ENOSPC." | ||
$FILE_WRITE -o create -f $TESTDIR/$TESTFILE0 -b $BLOCKSZ \ | ||
-c $NUM_WRITES -d $DATA | ||
ret=$? | ||
|
||
(( $ret != $ENOSPC )) && \ | ||
log_fail "$TESTFILE0 returned: $ret rather than ENOSPC." | ||
|
||
log_mustnot_expect space $ZFS create $TESTPOOL/$TESTFS/subfs | ||
log_mustnot_expect space $ZFS clone $TESTPOOL/$TESTFS@snap $TESTPOOL/clone | ||
log_mustnot_expect space $ZFS snapshot $TESTPOOL/$TESTFS@snap2 | ||
log_mustnot_expect space $ZFS bookmark \ | ||
$TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS#bookmark | ||
|
||
log_must $ZFS send $TESTPOOL/$TESTFS@snap >/tmp/stream.$$ | ||
log_mustnot_expect space $ZFS receive $TESTPOOL/$TESTFS/recvd </tmp/stream.$$ | ||
log_must rm /tmp/stream.$$ | ||
|
||
log_must $ZFS rename $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS@snap_newname | ||
log_must $ZFS rename $TESTPOOL/$TESTFS@snap_newname $TESTPOOL/$TESTFS@snap | ||
log_must $ZFS rename $TESTPOOL/$TESTFS $TESTPOOL/${TESTFS}_newname | ||
log_must $ZFS rename $TESTPOOL/${TESTFS}_newname $TESTPOOL/$TESTFS | ||
log_must $ZFS allow staff snapshot $TESTPOOL/$TESTFS | ||
log_must $ZFS unallow staff snapshot $TESTPOOL/$TESTFS | ||
log_must $ZFS set user:prop=value $TESTPOOL/$TESTFS | ||
log_must $ZFS set quota=1EB $TESTPOOL/$TESTFS | ||
log_must $ZFS set quota=none $TESTPOOL/$TESTFS | ||
log_must $ZFS set reservation=1KB $TESTPOOL/$TESTFS | ||
log_must $ZFS set reservation=none $TESTPOOL/$TESTFS | ||
log_must $ZPOOL scrub $TESTPOOL | ||
$ZPOOL scrub -s $TESTPOOL | ||
log_must $ZPOOL set comment="Use the force, Luke." $TESTPOOL | ||
log_must $ZPOOL set comment="" $TESTPOOL | ||
|
||
# destructive tests must come last | ||
log_must $ZFS rollback $TESTPOOL/$TESTFS@snap | ||
log_must $ZFS destroy $TESTPOOL/$TESTFS@snap | ||
|
||
log_pass "ENOSPC returned as expected." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.