From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795894837; b=nHhp/06ZpveHoT68kD00BuGj5xCNTQjOSQWokerECrBibjRQsrLAEHwR7pksi0k88mi1 omh2OAg7nuAm5uJmcLe3We52wzapza6oXy39YHucujlOp7NRyHu2PQj2groTlTr7W3Anx EVNYoYn9pTAK7pqJkGM0M4jfTdBUNuS9fSBAXIZYW53MRe+8QP0ur7T9fofAEF8OcTIuB V9z3Pky3K8E736IYv+OB1GZ1rZR5Y995BE1JhST+zEfVXc6IdShtgAY9cdyAOCjwwgB0N Jq7KzyDwPsvOHHN0hn2rlMya/S8jyOE3Xxa7zLwnrQjV6D8HFsOwspSQdwFWt2xZdew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795894837; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=AHnTPMtbz+vHuSoHDyt2UgwGrX8MeB4+2PRxiDzGstE=; b=tnxrAIjL4Yno//DOvdEC42ofse06R0mWSi2unHQsjHj/LJ92/ijtIv1b4RntLGQ95YtI rCZ0iQli6hzJEQCbYqxTtUEMIyfI3jXafEzIMw6QsniBEZOwuix+mufQ4AxhDkKMVpYhR OZL19P85QHWARPhmfNwAHj67MYYtWp5I1X105a2xJt0yc3CPYn/qq4qRys5f7EEb5P6Pa bVYtRC/cOc0pJ1/mXVIOoZuIjDXrY4EUeNFsflhS5wTajrJVGLepVVrn6ZKU4bsT1YTMl tfN4mLgAsIdj2NGGFLSDCrQ5MKsrgDjVd3vfprYBDuQ3d6y0GxF4Vj09C8WcBpUtm6Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cs.cmu.edu; spf=pass smtp.mailfrom=andrew.cmu.edu; dkim=pass header.d=cs.cmu.edu header.i=@cs.cmu.edu header.a=rsa-sha256 header.s=google-2021 header.b=KlZJx0UR; arc=none smtp.remote-ip=209.85.160.176 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C57B606A31C for ; Sat, 28 Nov 2026 19:40:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7C57B606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cs.cmu.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=andrew.cmu.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cs.cmu.edu header.i=@cs.cmu.edu header.a=rsa-sha256 header.s=google-2021 header.b=KlZJx0UR Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-53664b4860bso99721391cf.1 for ; Sat, 28 Nov 2026 11:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.cmu.edu; s=google-2021; t=1795894834; x=1796499634; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=AHnTPMtbz+vHuSoHDyt2UgwGrX8MeB4+2PRxiDzGstE=; b=KlZJx0UR7UGzsSH/+ATOcP/6I5FS+rIrMLoDva3ynKfPnJUvEOJFyJ1/UdISA12tTu 8dVNpprMqPoGRT39tjfsgzQ7yWL6swgQ4NsF6YRNEi/lSo6coPxetRZhysasbZFFeu+V UntrAr7rG4hB+amvLjV987Ek3RveDGQTW5ZC0WQNL5tsm4VYQ4ZKInqJijyXDD4ml7Z/ kDnBGsB6lHV0ijt7uXOBuMVJSX+bqAXa11tGGQdXjzDTr09nfZ5URPwSWez4rYgxtA02 Clh1eLIAYIaAzujwbL+gj9oIcEbRDPrTtEnzb88cVbmL4erbM+wOafmxdtmBY4n4BSRK gMsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795894834; x=1796499634; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=AHnTPMtbz+vHuSoHDyt2UgwGrX8MeB4+2PRxiDzGstE=; b=Vu4l9bTyRWXloRKkkJmDo37ypyD5g7mcO05PngOQKj+EVjEjLV7qdfHNvC5wLLBe2T E3isMYFcHUTQacQ6NNjYOAEeDmVz1TzTIGd6qX6NbZ7i0qgyHDY0RMwk8oNTsvK3MqQW qQeqJ4/sAFJCzz/XfCX3C/QBhEyND1zamgux7GRUyCqf8nzSBMhHaurDonArrL43zow+ r3bSCeTGOsMELqj3FpF+CUincztWA6VioKyMEo9WZuW0BPGYO7X3sc/BUrNCAQnv4B9E 46lKR5ypar/iwU3s5malFPaX7Vk2fRZnjH0bSNAi7OqLt3HOMoYgT011gvq0nJsvB2nA JuWA== X-Forwarded-Encrypted: i=1; AL+hErHlXlbK9aTu62Wtbvburp9cRqQI2m9ejxqw3WtwkHk5yHtXdfdKwV6i5vl6cPUMOupllFxb22Hy3zC7sl0=@vger.kernel.org X-Gm-Message-State: APuU4Z84jcL9iYseX/y9aCZBZ8TU+tqjywKuN+w1vcmlnZ5yZFevXuDb 88sApiDQHEqGM+09spId9VbizqRrLqRGm+5iSomsCt3JitCp7EuB+xnf6dgedSdNCA== X-Gm-Gg: AZFdTZeQWT2eTU1rRom5uykTvSTdTQTYXeuPiL6xoE82AFNNRuLUi81sa4OJWlhWDH9 507DADh02ZIDQjCrzRKeYKfB49dHuvFTbFpSboXCalCYM1RFFuaquBYus3zjqsPMoqcg+FfmcZ4 ySR3xwD8LbQhccdS5SL/NJJVWJgTemZYv4eTqRXs6UjP27G2QHkddpiBN3OUa7OGXbWVUq/oNRp oygpfXR82tbCIjD9Ce53Cwq9QEexDp6KqraaYm/3uHzAsJ1tpkk2yNpBoDWZ2P8Cpy9pO2KpXCn mY07tB3+rVzi/p0ckLUY/kPJ2j0u1EPoUF8UTAylk+S/pKaeg+lfO+P7e9iAntigZmoWOKqIXrJ 8nPcUTgk/7WYjhNVIeqScZW9x2Gw1LBmVyGkqnNF65bGsW/dEkoWTzKQQD3ekFQ0mQ9O1VqOToK HgwrkXNWWEJFB0nzA67NrEnVA6npRiPzHe1SgTGx3IgyMcmeQsmDmRI5m4bKOnz/p2p8k2w1Dmw 2VgstcuakKFkKeckAMkSynTRayi3XpqjAippszvrxGbwv+k1WtGMYcVrPtkch7LWt7VgGdYIH3S fd5oH9wOKV5yNf/ZuXwGj71kNOpuI9CkaCBMLO85D2S/45ea1sWJ0z3ua+TJfRxEsR/3LGg= X-Received: by 2002:a05:622a:1b94:b0:55c:4382:7c4e with SMTP id d75a77b69052e-55d76a2685emr533288931cf.16.1795894834381; Sat, 28 Nov 2026 11:40:34 -0800 (PST) Received: from cs.cmu.edu (tempest.elijah.cs.cmu.edu. [128.2.210.10]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d7889ea4csm239456721cf.26.2026.11.28.11.40.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 11:40:33 -0800 (PST) Date: Sat, 28 Nov 2026 14:40:20 -0500 From: Jan Harkes To: Andrew Morton Cc: "Lorenzo Stoakes (ARM)" , David Rheinsberg , Hugh Dickins , Vlastimil Babka , "Liam R. Howlett" , David Hildenbrand , Jann Horn , Alex Shi , Johannes Weiner , Pedro Falcato , David Rientjes , Rik van Riel , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonathan Corbet , Shuah Khan , Randy Dunlap , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Arnd Bergmann , Stephen Rothwell , Muhammad Usama Anjum , linux-mm@kvack.org, Andrei Vagin , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Chris Mason , stable@vger.kernel.org Subject: Re: [PATCH 1/4] coda: never point a file's f_mapping at a container's mapping Message-ID: <20261128194020.lc5sblsbe6pvv5mm@cs.cmu.edu> Mail-Followup-To: Andrew Morton , "Lorenzo Stoakes (ARM)" , David Rheinsberg , Hugh Dickins , Vlastimil Babka , "Liam R. Howlett" , David Hildenbrand , Jann Horn , Alex Shi , Johannes Weiner , Pedro Falcato , David Rientjes , Rik van Riel , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonathan Corbet , Shuah Khan , Randy Dunlap , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Arnd Bergmann , Stephen Rothwell , Muhammad Usama Anjum , linux-mm@kvack.org, Andrei Vagin , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Chris Mason , stable@vger.kernel.org References: <20261127-mlock-madvise-mprotect-ai-fixes-v1-0-e46b2b1eb435@kernel.org> <20261127-mlock-madvise-mprotect-ai-fixes-v1-1-e46b2b1eb435@kernel.org> <20261127124428.f1f66c6244d3e5c2811f56de@linux-foundation.org> <20261128010821.irhzl7qcqahz6onx@cs.cmu.edu> <20261127222308.a372076fef9e470ea264cbb5@linux-foundation.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261127222308.a372076fef9e470ea264cbb5@linux-foundation.org> On Fri, Nov 27, 2026 at 10:23:08PM -0800, Andrew Morton wrote: > On Fri, 27 Nov 2026 20:10:13 -0500 Jan Harkes wrote: > > > Yeah, I hit this while getting > > > tools/testing/selftests/mm/memory-failure.c to work on all Linux > > > filesystems. > > > > Did you test this without the actual Coda userspace? What was the > > cache consistency model your userspace was using? > > Couldn't figure out how to get Venus working (I wouldn't know what a > coda is if it bit me on the foot!) so a mockup thing over tmpfs was > used in place. > > > > OK, reran with real Venus and a writable file on the server. The below > repro makes a writable shared mapping, then opens and maps it again > while the first mapping is live. All 300 first mappings succeeded and > 299 of the 300 second mappings failed with EPERM. This uses one Coda > file and doesn't depend on Venus changing containers between opens. > > That one-line-removal fixes this up. Thank you so much for running that test. Rereading what I wrote, I'm sorry for my tone and truly appreciate the effort you put in reproducing the bug. Now I am really confused as to what the use of file->f_mapping actually is. I thought I understood how this mmap stuff worked, but clearly I do not. > I also hit a lockdep splat along the way. That's also appended along > with a slop-coded "fix" which I haven't even looked at, sorry. But it > did make the splat go away. Sweet, it may be slop coded but it looks good. It fixes both the lockdep my moving the upcall copy_to_user outside of the locked region, but it also corrects an obvious bug in the error handling when copy_to_user fails. Thank you, Jan