Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp490239pxy; Thu, 22 Apr 2021 06:52:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx24C/HsClpoIb+fYsfcy+f7CC/9WwV9Uzvczh7QXXvzuDj1bzTofftf/umNYj7V7uRMass X-Received: by 2002:a62:a21d:0:b029:264:fa97:32dc with SMTP id m29-20020a62a21d0000b0290264fa9732dcmr3659890pff.32.1619099551152; Thu, 22 Apr 2021 06:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619099551; cv=none; d=google.com; s=arc-20160816; b=iqkGvd+RUzqSREtVXtuL/VnxrcuMBfv6egRcHtV2neUuNLtSWSiboFwnixXbAYmW4Q fGESFr8iPUEpSNqJ6/IVgD86Tm9vzTOA01ck4M2k4/yZHB29dhOVlmEobRrT9494NrBj qEhCJXDeDdl6uhzNQ4bITZMqKvlq0HyDPwqmn1++tNh6XSDDqjHSeDz2U08cUs+K4/cW lwGfmGZsSvHA+Lkz/ga56uOaW9CmH61xq8x84OtYNF1jCvqMqxv78g7qaZ7WIw7a3xt1 +GLbcbRD19gt9KVq+QUKKC2gEF2o6cpnnSoJmAnh3vWET811CrjKPYM4N+sJosJNAI59 W+8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sc812S/XH0xi1daedR2N2rrASOXlL4IU8Kqiol/mJyg=; b=sB44TldaEoTvAAM//I10G2e2t8C7m9rfb3/6wyoox8PtIXwuCVa7x9Af7N6WtnTowW 7Vr1mDiVI4YhTiUf85qQ1vDcyFcyTJbVjGxFESTACH7n3n46LpHekmWPgFVSkFjVgtra sQvOoaf44TqRUncnRNQspUm/IRWy5F8vlARROsIbz2ypJoHZUvJ/9bwbWXTkwmqe5sL2 NF56IyvknbdG2Dbj9A+dlYor4w6GEFWgW6BpkSnhjhNEjQXRKKTXww07Kor0wU75DpAX vLfTnBGY3AwEv89xibIIVH7Ho2/OaNUhh1SuguQguGw8jCYoPcsCJ73iUSoHBHCV97Po TxBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cs-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=ilf7MiKP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmu.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x29si3471023pgc.534.2021.04.22.06.52.19; Thu, 22 Apr 2021 06:52:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cs-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=ilf7MiKP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmu.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236661AbhDVNvm (ORCPT + 99 others); Thu, 22 Apr 2021 09:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236236AbhDVNvl (ORCPT ); Thu, 22 Apr 2021 09:51:41 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31ACBC06138B for ; Thu, 22 Apr 2021 06:51:07 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id o5so46317628qkb.0 for ; Thu, 22 Apr 2021 06:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs-cmu-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sc812S/XH0xi1daedR2N2rrASOXlL4IU8Kqiol/mJyg=; b=ilf7MiKPmuLDCJimMx6HY09IjE0RtI8ZvwvdH6B6zfOQjt3XpT5zeEzYvZWEpLAdYN HgsytpNQ77VJrUr18k2RiREzJkRdWu0QpLA0tkuRNsG9RJNB3q1uAdrnsyEo+VtE/bkz B2jsPuMqREtLJPtddAk+Uo17G2/m8PXB2rUUgxU0rvhBi59tk2mXxC2MGCjH0Pjpp+VT mX7+laaPBOMCRKCQqV4hxZwgrlInehA3Gism8b/RZbMqm7co4BAjldanO0P5uXETbut4 mzMIosKNAMoPho12DmysXBBsk5jjrFMiiqQDcmOd/Ypwjfkh2IjEZ9SeT0+ozvuXOA6A QC1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=sc812S/XH0xi1daedR2N2rrASOXlL4IU8Kqiol/mJyg=; b=kSqnlF5ZeXcbOdPLxdsAbde0+qsANLsDKsA/dbD693LIznTJX+AouU+jcbMO9XBetw 4oRMdbNOxuMlzg9iFdNP+or+yahCgZVftTDcrWUV5mOH/LndilrwKslaZBCxafmpWe9d 5uzy76I1ByP3wKiVsHDNvCmIYc1ygG9mFe3vSttU5SXOd2Yp7kdBVw2SyCwsU9ymOFnh ZnJo1kDB2KTh18gzePu+YpaE3REuGLyDoU9TlEOmBDabZffu3QNWILR+CSGbkBEGgFcK BiiQrsB7j1PfBWlW4KFDxDlpf044NbeVz7/mj+bpw0pLvNao4Z3c+VgCEVuYnuHv2JDs vULg== X-Gm-Message-State: AOAM533S0mgQ5piLblrrEFiCC8cacZpVyfesSgBjS5RXhLjrftXDBWpX TAjL4JkDalorWjT37Kg9KQeavw== X-Received: by 2002:a37:c202:: with SMTP id i2mr3647788qkm.296.1619099466408; Thu, 22 Apr 2021 06:51:06 -0700 (PDT) Received: from cs.cmu.edu (tunnel29655-pt.tunnel.tserv13.ash1.ipv6.he.net. [2001:470:7:582::2]) by smtp.gmail.com with ESMTPSA id g1sm2207278qth.69.2021.04.22.06.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 06:51:05 -0700 (PDT) Date: Thu, 22 Apr 2021 09:51:03 -0400 From: Jan Harkes To: Christian =?utf-8?B?S8O2bmln?= Cc: linux-kernel@vger.kernel.org, linux-unionfs@vger.kernel.org, dri-devel@lists.freedesktop.org, coda@cs.cmu.edu, miklos@szeredi.hu, akpm@linux-foundation.org, jgg@ziepe.ca Subject: Re: [PATCH 1/2] coda: fix reference counting in coda_file_mmap error path Message-ID: <20210422135103.hif4a5znhzt4pc6f@cs.cmu.edu> References: <20210421132012.82354-1-christian.koenig@amd.com> <91292A4A-5F97-4FF8-ABAD-42392A0756B5@cs.cmu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 02:39:41PM +0200, Christian K?nig wrote: > Am 22.04.21 um 14:27 schrieb Jan Harkes: > > Looks good to me. > > > > I'm also maintaining an out of tree coda module build that people sometimes use, which has workarounds for differences between the various kernel versions. > > > > Do you have a reference to the corresponding mmap_region change? If it is merged already I'll probably be able to find it. Is this mmap_region change expected to be backported to any lts kernels? > > That is the following upstream commit in Linus tree: > > commit 1527f926fd04490f648c42f42b45218a04754f87 > Author: Christian K?nig > Date:?? Fri Oct 9 15:08:55 2020 +0200 > > ??? mm: mmap: fix fput in error path v2 > > But I don't think we should backport that. > > And sorry for the noise. We had so many places which expected different > behavior that I didn't noticed that two occasions in the fs code actually > rely on the current behavior. > > For your out of tree module you could make the code version independent by > setting the vma back to the original file in case of an error. That should > work with both behaviors in mmap_region. Awesome, I'll give that a try, it may very well be a cleaner solution either way. And thank you for following up after your original patch and finding the filesystems that mess around with those mappings. I'm sure it would have taken me a while to figure out why file refcounts would go weird for some people, especially because this only happens in the error path. Jan