Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758026AbcCCSFl (ORCPT ); Thu, 3 Mar 2016 13:05:41 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:24702 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756575AbcCCSFj (ORCPT ); Thu, 3 Mar 2016 13:05:39 -0500 To: Linus Torvalds Cc: "Darrick J. Wong" , Jens Axboe , Christoph Hellwig , Andrew Morton , "Martin K. Petersen" , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton Subject: Re: [PATCH 2/2] block: create ioctl to discard-or-zeroout a range of blocks From: "Martin K. Petersen" Organization: Oracle Corporation References: <20160302040932.16685.62789.stgit@birch.djwong.org> <20160302040947.16685.42926.stgit@birch.djwong.org> <20160302225601.GB21890@birch.djwong.org> Date: Thu, 03 Mar 2016 13:01:11 -0500 In-Reply-To: (Linus Torvalds's message of "Wed, 2 Mar 2016 15:49:53 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 795 Lines: 21 >>>>> "Linus" == Linus Torvalds writes: Linus> .. but the flag doesn't even set that. Even if you avoid TRIM, Linus> there is absolutely zero guarantees that WRITE_SAME would do Linus> "real storage blocks full of zeroes backing the LBAs they just Linus> wrote out". That's not entirely true. Writing the blocks may cause them to be allocated on the storage device (depending on which flags we feed it in WRITE SAME). The filesystems people were wanted the following semantics: - deallocate, don't care about contents for future reads (discard) - deallocate, guarantee zeroes on future reads (zeroout) - (re)allocate, guarantee zeroes on future reads (zeroout) Maybe we just need a better naming scheme... -- Martin K. Petersen Oracle Linux Engineering