From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83C99C38A2D for ; Tue, 25 Oct 2022 18:03:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4BF08E0002; Tue, 25 Oct 2022 14:02:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FBB38E0001; Tue, 25 Oct 2022 14:02:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EABF8E0002; Tue, 25 Oct 2022 14:02:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7C5178E0001 for ; Tue, 25 Oct 2022 14:02:59 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1F7FD160B38 for ; Tue, 25 Oct 2022 18:02:59 +0000 (UTC) X-FDA: 80060242878.05.30AA230 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 9B10DA0011 for ; Tue, 25 Oct 2022 18:02:57 +0000 (UTC) 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=44uWC48wo/Cp/64RSzfSDsWEyCAAdK5b7+ipH6hbEdc=; b=C3o7hwOoE+PBSxhR4e+IS44FIK rLHloVBjZ4//HuxTkv11mzMCFofTHWYprSeofvXNC1Mc5dCC0DqZXw5O+Hyx/vmHp9Iud7UuYAL01 +2r0tV99ILe6Kd4nVTb+yTsTD6hbg2baftoBJVwxTyAzGTKTOzmzKbo/Qxz9TnFF05r2sVM7GSAXH Sq/PNXdWypaglUNnz1aNKXXj+VyJh8nfHKMpBJR8TxCpd8HLeSDgzJaXQ2zPdAw+7nTQ1FLMoYFxd iK5m6yWW31J82STCC53rIFYa2kOheVfEDN8z7+FhcjXMDXQZo1I0W/nZHeUa3lHA/1ZcA/tYGF29O 66FuD0sQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1onOGL-00GRcF-4z; Tue, 25 Oct 2022 18:02:53 +0000 Date: Tue, 25 Oct 2022 19:02:53 +0100 From: Matthew Wilcox To: "Darrick J. Wong" Cc: xfs , Shiyang Ruan , Andrew Morton , Linux Memory Management List Subject: Re: [PATCH] xfs: fix incorrect return type for fsdax fault handlers Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666720978; a=rsa-sha256; cv=none; b=aT6eSEn987CoOd+aIEd0Zz3r/nT9ZBkh8hp0fTrHoHml3ZXCT0SEB4UP//UUJmlZoLVq1w rhDMNWlFe8pt2mPLb3npbr5xvZ09xtfzGZ7PidngBYBj236b8AgR/DimGgkD1L678QxULA c1bH1eCMFlY0bKggFJ0G1YuUjwefk7Y= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=C3o7hwOo; dmarc=none; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666720978; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=44uWC48wo/Cp/64RSzfSDsWEyCAAdK5b7+ipH6hbEdc=; b=Ex3CmWlp2X1ziIAyZRPxVq8G356Bztklfh3sIgsCd1uaVIYNT2dPuKtSu2x3YUUcARmdMU vVGiPZNVFgYnJ5fqf49FeqSRSczfiboSipx2F2Fsrgtjb1r4fuuk6Pev5d8mOOPl+n0sf0 o96ddfu2Osp+CuU7uagO+PMJ9I5zN78= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 9B10DA0011 X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=C3o7hwOo; dmarc=none; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: gn4fy1prygcyzi6nikjonon5ozbrcfkc X-HE-Tag: 1666720977-234577 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 24, 2022 at 05:18:33PM -0700, Darrick J. Wong wrote: > On Mon, Oct 24, 2022 at 10:56:48PM +0100, Matthew Wilcox wrote: > > On Mon, Oct 24, 2022 at 02:32:18PM -0700, Darrick J. Wong wrote: > > > Fix the incorrect return type for these two functions, and make the > > > !fsdax version return SIGBUS since there is no vm_fault_t that maps to > > > zero. > > > > Hmm? You should be able to return 0 without sparse complaining. > > Yes I know, but is that the correct return value for "someone is calling > the wrong function, everything is fubar, please stop the world now"? No, it's "success, but I didn't bother to lock the page myself, please do it for me", which doesn't really make any sense. I think in this case, having not initialised vmf->page, we'd probably take a NULL ptr dereference in lock_page(). >From your changelog, it seemed like you were trying to come up with the vm_fault_t equivalent of 0, rather than trying to change the semantics of the !fsdax version.