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 83E18C38A2D for ; Tue, 25 Oct 2022 22:30:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BAC78E0002; Tue, 25 Oct 2022 18:30:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 16AF18E0001; Tue, 25 Oct 2022 18:30:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 059E38E0002; Tue, 25 Oct 2022 18:30:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EC7568E0001 for ; Tue, 25 Oct 2022 18:30:20 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B27E81C67F4 for ; Tue, 25 Oct 2022 22:30:20 +0000 (UTC) X-FDA: 80060916600.15.A97A45E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 49D4840019 for ; Tue, 25 Oct 2022 22:30:20 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5C20261AE3; Tue, 25 Oct 2022 22:30:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAFDFC433D6; Tue, 25 Oct 2022 22:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666737018; bh=zxBH4708yQt8iacwO75MOaaO6C4X1oFYufgeP/P3ooI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IfY7/lUa5URXVGZx90t2AnDdh6wY9KQF7o+M3Y+CvOXVgWH2QlyVduljtD8fssHlI Jt3unaZDOQEmn4plxcxSK217tLUm9A+8cs0RvZjuFxwIQvAUotSE6yQ2jZIf9Z0O5F jQE+k+0REimA3eWG6/FpbXTnE68RMofSP5cqcw/QFkV1j/SkCG9w4VpJsjP8CwCJxI hnnTfFInbAOIvQ7xKbUhilUO8wslMghRniB9FjYA4jj7IFpgY8/elkXAlnqevbK7oW LcImLGWq1EuYMijNONWt3fvYU860D0r/AWmCrQ9445YuEW59jJ7DFJbEm25tuYi+0d WruGGtDCuV5Kw== Date: Tue, 25 Oct 2022 15:30:18 -0700 From: "Darrick J. Wong" To: Matthew Wilcox 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=1666737020; a=rsa-sha256; cv=none; b=KEcEv8qya7ElO9e3ztPPo70A19y/b0OD+dwZqG3xSLEVvyRieUgEBvdATbkOMJh+BeLg/k 57pF8+cy9tWEWUEfoQ6KXTXtnK0E1tEWbm3JyOFxqlEkp8GSrZ6eNoatmtbkVepbUjkbHW jVha4Fsy28Lsspjzu0yaXkY0j7VGDyE= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="IfY7/lUa"; spf=pass (imf07.hostedemail.com: domain of djwong@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666737020; 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=huX4rHm4FtUkQkKmY0GmYq/wDUaGkWc4aPkB7LgQHhc=; b=29Uy7Ti4uVNrn2A0cKX8wHhtYh0svXPzQOoOvacGVG4kDXK3RmvY0PiM7+ydG6GED0sTtJ Z6iT099NJFVJL/dOgSh9kpBI7/qtTF0RGCw3lds0xcBM5JAI6SEeF7Kv2wVjD/ZwCCxMQ1 B8p51Z7R/i9zvWuI8Aei7V9YftMjUSc= X-Rspamd-Queue-Id: 49D4840019 X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="IfY7/lUa"; spf=pass (imf07.hostedemail.com: domain of djwong@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam04 X-Stat-Signature: ntbetfzhqixsyy6dykmyun38nrti3ot5 X-HE-Tag: 1666737020-655384 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 Tue, Oct 25, 2022 at 07:02:53PM +0100, Matthew Wilcox wrote: > 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(). Yes, that's why I don't want to leave the !fsdax stub returning zero. --D > 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.