Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1384173rwr; Thu, 27 Apr 2023 17:21:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Y2+Z4JlrBE0ovdtM3SYGEAXAnvNqoNIGdMz7PxRjDKw0kKHDrfihBu5WdhZzrBhg3FimA X-Received: by 2002:a17:903:1246:b0:19a:bbd0:c5cc with SMTP id u6-20020a170903124600b0019abbd0c5ccmr4126767plh.60.1682641292201; Thu, 27 Apr 2023 17:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682641292; cv=none; d=google.com; s=arc-20160816; b=sxPPMPYoo0eBAGv5koVb/ClwJqqSliukBorB3ZFGFiEwzynPGzcxGVEVD9V5meJRH9 P7gMrF6chA3iGRQ5YXb7bBDdYAWj4q7n0yL2eSb+kBz07vcx00sn+q+AcUa5YzCRQrxh h0jaedQ4Ii+fB6jNzzNkXCni6VNVffB2krWQuF3p726VTIT63UANB2aF3UAen3npN7gy xQ+YKOvKgllsemc4hhIiBz/+aBscmcHr9jedNwwe+QyXYJHpKqDPlWhpCAzQB9b0RWxt Yaj1E0B5j35UM5DuZol8cEpm8YN/nFV3WIOGsu4Dr6B1b6nOdjOXzyePzGCrmtSdv28m p4Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Id5MRY6csHEAIIsWpDo8U+QRcsMChe0pvKJYUVbkiTw=; b=0PCE58bYuGYVORF4T1UM+f5iOE79EbbDUpRBnkfhaz5pMimIluC46+Ackuxgk/4cAm +kZwYRk9PbJAKe7osk1E7BMc/mhD6oCZtWLwR4hAvYnwREV1NHd6Z6aPiNxMHY6qgtDL LumIuX6QlBAYbWZn4q8RqtlcYhtHPHJzQUcyUl0kg6IO8LJtZfWEdyMKC5HinW/gyOsH PzzdaYvbsXK3vo1iUlrOQCLNKR7HCvdbxTsjJV5Qjzgg5O+Cx9/Dwzq8+MbqHBaIBcnC 6Yjq/uMmE+l/FDLmLu5QH1dHndc8yI37GktEi19bSHbSuUuIZFxUy1Gk5fEdxoNtzwDf wzRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=E4tcX0SO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a170902f2d100b001a6b9ab7025si18823157plc.359.2023.04.27.17.21.20; Thu, 27 Apr 2023 17:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=E4tcX0SO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344460AbjD0XtC (ORCPT + 99 others); Thu, 27 Apr 2023 19:49:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344436AbjD0Xs5 (ORCPT ); Thu, 27 Apr 2023 19:48:57 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB8DA1BF8; Thu, 27 Apr 2023 16:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Id5MRY6csHEAIIsWpDo8U+QRcsMChe0pvKJYUVbkiTw=; b=E4tcX0SO90gvZiDhw+vy7p9mK7 IVDKsvFI1+xO294jdGE6g3uuZRS9vT9ODrLCSgePm+CAgSNhjxAHQX1Lok2YzWv8yN0WmDDP3FAY3 TdHn3hQowDzhd2MQaLNe0MNI40WePW2xUr+bGNMkhcYgHlOGM1lT4pVDbwVzgl66yK6lelvYoxq08 eQln+0WMuJL13DnbinnqclALtKIjb/MkbNu6tO8wjC7Xv3eyic1RHGpnSaiLYJ3MFDwtgnayz1fqH aoxQySM3VUVMgmp37tiTy59a/abVnCrvZEJWMqmkFeGRghmnoagtpQjJI9rdRARKyKuLaFVCd1O43 5WP9Eyrw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1psBLb-0043WT-N4; Thu, 27 Apr 2023 23:48:23 +0000 Date: Fri, 28 Apr 2023 00:48:23 +0100 From: Matthew Wilcox To: Jane Chu Cc: Dan Williams , vishal.l.verma@intel.com, dave.jiang@intel.com, ira.weiny@intel.com, viro@zeniv.linux.org.uk, brauner@kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] dax: enable dax fault handler to report VM_FAULT_HWPOISON Message-ID: References: <20230406230127.716716-1-jane.chu@oracle.com> <644aeadcba13b_2028294c9@dwillia2-xfh.jf.intel.com.notmuch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 27, 2023 at 04:36:58PM -0700, Jane Chu wrote: > > This change results in EHWPOISON leaking to usersapce in the case of > > read(2), that's not a return code that block I/O applications have ever > > had to contend with before. Just as badblocks cause EIO to be returned, > > so should poisoned cachelines for pmem. > > The read(2) man page (https://man.archlinux.org/man/read.2) says > "On error, -1 is returned, and errno is set to indicate the error. In this > case, it is left unspecified whether the file position (if any) changes." > > If read(2) users haven't dealt with EHWPOISON before, they may discover that > with pmem backed dax file, it's possible. I don't think they should. While syscalls are allowed to return errnos other than the ones listed in POSIX, I don't think this is a worthwhile difference. We should be abstracting from the user that this is pmem rather than spinning rust or nand. So we should convert the EHWPOISON to EIO as Dan suggests.