From owner-svn-src-all@freebsd.org Fri Apr 14 20:29:40 2017 Return-Path: Delivered-To: svn-src-all@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 D6F30D3A484; Fri, 14 Apr 2017 20:29:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22e.google.com (mail-qt0-x22e.google.com [IPv6:2607:f8b0:400d:c0d::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E65A1760; Fri, 14 Apr 2017 20:29:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22e.google.com with SMTP id m36so70993782qtb.0; Fri, 14 Apr 2017 13:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VovzLQB9qyODv+kHXRjOTRsdIRJA83w3RA3ZxyZPyNo=; b=m4UCUVCTwc3Axhp5SJl/MlS1wHatvP4zKgylh+m4BQMiJnqXjWZdoL+N8gLFNoyYDx lcLMyu6nu8LeToMALAYXtZ1b04K52CT1Atk/nx4vcUplOb0nMb1XZTE4WhI6hJtYXKHI n+EW4CyC3msP4cwRZ+pONhnu95xGWT+8lF0NM/kIbcZ4OWr4Wfh1Ia7JQ7f7q9Zyo3RW TXEPeqZQ+RqCedi5H0/TXfBBPGcwM+0oN2YZ7RmDOA/it/wJh7kN+LEJlIdcRfXIAXSR GQPmThyE5lsBdh63yeU1L5Hy28HtI5LxKvL6jwfToni6Cal5Kf2zuD/5MZZdSAGj2WPO DOQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VovzLQB9qyODv+kHXRjOTRsdIRJA83w3RA3ZxyZPyNo=; b=Z+F0tBHGQIwtJ0PVGvejkq3urTUH+CP3Dub3mtqHgqU37LcvJAYAuK5rBEYaJyqAJb FeckUediaAYZv/dnPnscCKH2VspGIFBPVm5REaQjxD7bsx2Rgnmvu2op4zVA8lKYNF+c 8iNwgY7HVZn0K/vBaUKqDv4tCgZWWDHtoTQPCIxB86KiEC7PJChuj2mTQ/D0wDQCFl/a WIKswGzt0ErdrOKGkWib5x40Gi8LfRINW/DWPtrsFpYljYaC0JolYZKuqpKfuqopaL4G fLES2SzaWWeWqOR8we5ZVqO4oO+EdhoyL95KFZATvJ5H0do6LYN/J668T2dPS7kmNe0l UzxQ== X-Gm-Message-State: AN3rC/48bY7hZRQ7Jbldi5Fhf0FXgxM2jY37LfEFsA4LSOQ12v08Afyq 5cG01e6KOwU2HAg6 X-Received: by 10.237.62.46 with SMTP id l43mr8403536qtf.88.1492201779507; Fri, 14 Apr 2017 13:29:39 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id a19sm1880352qta.48.2017.04.14.13.29.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 13:29:38 -0700 (PDT) Sender: Mark Johnston Date: Fri, 14 Apr 2017 13:29:18 -0700 From: Mark Johnston To: Alan Somers Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:29:40 -0000 On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > > Author: ngie > > Date: Fri Apr 14 19:41:48 2017 > > New Revision: 316938 > > URL: https://svnweb.freebsd.org/changeset/base/316938 > > > > Log: > > savecore: fix space calculation with respect to `minfree` in check_space(..) > > > > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > > representable data to INT_MAX. Check the values received from > > strtoll(3), trimming trailing whitespace off the end to maintain > > POLA. > > - Use `KiB` instead of `kB` when describing free space, total space, > > etc. I am now fully aware of `KiB` being the IEC standard for 1024 > > bytes and `kB` being the IEC standard for 1000 bytes. > > - Store available number of KiB in `available` so it can be more > > easily queried and compared to ensure that there are enough KiB to > > store the dump image on disk. > > - Print out the reserved space on disk, per `minfree`, so end-users > > can troubleshoot why check_space(..) is reporting that there isn't > > enough free space. > > > > MFC after: 7 weeks > > Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > > Tested with: positive/negative cases (see review); make tinderbox > > Sponsored by: Dell EMC Isilon > > Differential Revision: D10379 > > The free space calculation is still uselessly conservative, because it > doesn't account for the fact that core dumps will always be either > spare or compressed. The result is that savecore will frequently > refuse to save corefiles even when there's plenty of space. I > proposed removing the space check altogether in > https://reviews.freebsd.org/D2587. However, I agreed to wait until > after the compressed core dump feature was merged, because then mostly > accurate space checks will be possible. AFAIK the compressed core > dump feature still hasn't been finished. I had held off on it for a while because it was going to conflict with the work to add encrypted dump support, which of course has finished. The patch to add compression support is here and should largely still work: https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff I've been hesitant about pushing it forward: - The dump_write* APIs need some simplification after the addition of encrypted dump support and support for dumping to 4Kn drives. - I'm not sure how encryption should compose with compression. It seems intuitively obvious that we should compress before encrypting if the compression is to be of any use, but I don't know enough to know whether the compression might somehow compromise the effectiveness of the encryption. If anyone has some insight on the second of these two points, I'd appreciate hearing it.