Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21370494rwd; Thu, 29 Jun 2023 15:15:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57NAtuo0nsgBXnkRwePQ3JTVmJwL1NexYnDlabbIX3cVieF2dStCmYII2WwRCZUqCwzG+/ X-Received: by 2002:a05:6a20:42a5:b0:12a:f4d2:3e25 with SMTP id o37-20020a056a2042a500b0012af4d23e25mr1246884pzj.29.1688076916050; Thu, 29 Jun 2023 15:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688076916; cv=none; d=google.com; s=arc-20160816; b=gOat5kmzUi8p4APaNdRuZ58idqTlvwP/h/arN7GMFOk79tEwkvbcUwbuqQrEGBlhPB GHgnQpF4/6/oDc8DKFSrFo5SVDxWLBXlFmFbJ78JSV6wnUMvIOfJ925KE9wrgKquFEZI EVh1dlQnPYhVPP8yuzGqxx7iKVx1cK6LCy+VgZpRWuobpSDLfQS9eriRM+e/Pbrh2EJE pjPBII4SioXtdxPgVzA5aIrK4NJqDEvM0aQMFY8TS8qV+sLTauTnzbbaH19a/+GBWhOG AdWWmFAoGM+Ar4h9K+qHZa43XDF0U0wy5x/qGS7+5LRKwxKTgX6Tx7lFf3X5+FReCMO1 GLWQ== 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=XHh/jI/bdXc93KNn2kIm/kDXKE1qBvxy+TINr4YmCdA=; fh=2/OepbD16sII06AHmQTJgD7xcw2OMNoUEY9t7KuTeGw=; b=Or6O1APmGI7bHHxm/rC5Sw/6aYEOBnIXdSdOT8U5oh8Wvro5OVz1cEa5Zz50g4I/51 +Ss1Xg4cpP3psvVhbU6ebIHyakwlEXHCOPv9GnHq4SF87lGWavEtf6C4CVFqnq4isX8f Amnp3AWBWmXRfxJ9BVQnrTQTegZrbzIFe7vdKK3/b+wEU52JEj+WKztVp1bl43yfRIzZ abQYCuukShrVg0wyOktTIHWBD/E0yYGAiraWGRo8UNMpC4tF4dfSgzchWOLRu557UOOs Ix2zdsvyMbxHv0RzF766kA7zPK7pXSXQBU3Y/dLzXJSnKSAFA8AzMUPMAX40vzjRj2qy G82g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=k0Fa9zvD; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k135-20020a62848d000000b006687255a465si10432164pfd.298.2023.06.29.15.15.01; Thu, 29 Jun 2023 15:15:16 -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=fail header.i=@mailo.com header.s=mailo header.b=k0Fa9zvD; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232088AbjF2Vtw (ORCPT + 99 others); Thu, 29 Jun 2023 17:49:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231787AbjF2Vtq (ORCPT ); Thu, 29 Jun 2023 17:49:46 -0400 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A068530C4 for ; Thu, 29 Jun 2023 14:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1688075378; bh=Js+wviSqbRoPvM+R8wP9vofgFSlATI7fQH4Z+TLAhBM=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=k0Fa9zvD/neTdeo9mrtsWdPMl5QyAU47R0HPgkV0n3DfUxzs+HW9bCbv4lnoCY40F er7hsbCoE5Bc+gThNcAGF4dxuvBZu8KLnBmCVsvuJ1JIMe3YJ4eSxIoRcyB4A8cL3m BJTdzrUAxFN56lr07AN7OrVIsIaAxV35ZwLdNjKs= Received: by b221-2.in.mailobj.net [192.168.90.22] with ESMTP via ip-20.mailobj.net [213.182.54.20] Thu, 29 Jun 2023 23:49:38 +0200 (CEST) X-EA-Auth: bfXx7m6mBHf0bbbEInyNo09c2pO3FAllciMTjbbMOaPyxDfwVkN/aN/2e4+nmIyLXNLywzBzQgffhdOIJnAiNivQauo1214l Date: Fri, 30 Jun 2023 03:19:29 +0530 From: Deepak R Varma To: Bob Peterson , Andreas Gruenbacher , cluster-devel@redhat.com, linux-kernel@vger.kernel.org Cc: Ira Weiny , "Fabio M. De Francesco" , Sumitra Sharma , Deepak R Varma Subject: [PATCH v3 1/6] gfs2: Replace kmap_atomic() by kmap_local_page() in stuffed_readpage Message-ID: <1955d9c440240f4c97efd80f3efca550871fe0ef.1688073459.git.drv@mailo.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, 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 kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Therefore, replace kmap_atomic() with kmap_local_page() in stuffed_readpage(). kmap_atomic() disables page-faults and preemption (the latter only for !PREEMPT_RT kernels), However, the code within the mapping/un-mapping in stuffed_readpage() does not depend on the above-mentioned side effects. Therefore, a mere replacement of the old API with the new one is all that is required (i.e., there is no need to explicitly add any calls to pagefault_disable() and/or preempt_disable()). Suggested-by: Fabio M. De Francesco Signed-off-by: Deepak R Varma --- Changes in v3: - split into 2 patches - included in the patch set. Was sent as standalone patch previously Changes in v2: - Update patch description to correct the replacement function name from kmap_local_page to kmap_local_folio fs/gfs2/aops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 3b41542d6697..3eac4f2f5c27 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -432,10 +432,10 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page) if (error) return error; - kaddr = kmap_atomic(page); + kaddr = kmap_local_page(page); memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), dsize); memset(kaddr + dsize, 0, PAGE_SIZE - dsize); - kunmap_atomic(kaddr); + kunmap_local(kaddr); flush_dcache_page(page); brelse(dibh); SetPageUptodate(page); -- 2.34.1