From owner-freebsd-bugs@freebsd.org Sat Oct 28 06:17:24 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE218E5CDBD for ; Sat, 28 Oct 2017 06:17:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1E3364D9D for ; Sat, 28 Oct 2017 06:17:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v9S6HOhc054018 for ; Sat, 28 Oct 2017 06:17:24 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 223287] posix_fallocate(2) attempts to allocate impossibly large files and cannot be killed on ZFS Date: Sat, 28 Oct 2017 06:17:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: glenn.weinberg@intel.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Oct 2017 06:17:24 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223287 Bug ID: 223287 Summary: posix_fallocate(2) attempts to allocate impossibly large files and cannot be killed on ZFS Product: Base System Version: 11.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: glenn.weinberg@intel.com ZFS allows posix_fallocate(2) to attempt to reserve any amount of space, ev= en if the request is larger than the entire capacity of the pool. While it may= be true that in theory pools are "infinitely" expandable in ZFS, this behavior= is not in the spirit of posix_fallocate(2), which is supposed to "guarantee" t= hat subsequent writes to the allocated area in the file will not fail due to la= ck of space. (There has been previous discussion of the validity of posix_fallocate(2) on COW file systems such as ZFS, but that is not the iss= ue here.) Furthermore, posix_fallocate(2) operates by repeatedly writing to the file.= The ZFS behavior of writing forever might be tolerable, albeit not ideal, if the posix_fallocate(2) call were interruptible, but the entire sequence of writ= es is performed under a lock, so once the unsupportably large request has commenced, there is no way to stop it short of a hard reboot. Returning ENOSPC if the requested allocation is larger than the current pool size (or file system size for UFS) seems like a relatively simple check to make, and a reasonable compromise between the spirit of posix_fallocate(2) = and the theoretical expandability of ZFS. --=20 You are receiving this mail because: You are the assignee for the bug.=