From nobody Sun Feb 8 16:34:14 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F318EB64DC for ; Mon, 26 Jun 2023 06:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbjFZGvb (ORCPT ); Mon, 26 Jun 2023 02:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjFZGv3 (ORCPT ); Mon, 26 Jun 2023 02:51:29 -0400 X-Greylist: delayed 41273 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 25 Jun 2023 23:51:24 PDT Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC97DE7B for ; Sun, 25 Jun 2023 23:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1687762277; bh=Pgn7S7GW3U6u3f3Hy8tc/2FAPWJkWS46rNADXIMWKy4=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=PRpAQuq9eHEuXF0MJhvvlHEm7wlDa1lGzzqt5J8Q+MaLVMRLZeFFkRIjrJglUR2lI llD8LnPmQSEsdNFiQm/hk5FNXr9z+fMcksD+w9U8jldbTs+Gm4IDJ1yqK3gMQ58Mg3 yjY/gYln4YRMoT85o2c/Vum7nYKQJGoJtEuUkz1k= Received: by b221-6.in.mailobj.net [192.168.90.26] with ESMTP via ip-20.mailobj.net [213.182.54.20] Mon, 26 Jun 2023 08:51:16 +0200 (CEST) X-EA-Auth: Eu/Q3BBGOZASBNR3dpmx6ET/wlVioDsvV4FoUhX+WcVKwrfl6adetu3e6VtSUbBvxZC7qTm86HVr6Td9HE/uWXqx2GV65Gol Date: Mon, 26 Jun 2023 12:21:09 +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 v2] gfs2: Replace deprecated kmap_atomic() by kmap_local_page() Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Therefore, replace kmap_atomic() with kmap_local_page() in gfs2_internal_read() and 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 gfs2_internal_read() and 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()). Signed-off-by: Deepak R Varma --- Note: The Patch is build tested only. I will be happy to run recommended te= sting with some guidance if required. Changes in v2: - Update patch description to correct the replacement function name from kmap_local_folio to kmap_local _page=20 fs/gfs2/aops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 3b41542d6697..7bd92054d353 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -432,10 +432,10 @@ static int stuffed_readpage(struct gfs2_inode *ip, st= ruct page *page) if (error) return error; =20 - kaddr =3D kmap_atomic(page); + kaddr =3D 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); @@ -498,12 +498,12 @@ int gfs2_internal_read(struct gfs2_inode *ip, char *b= uf, loff_t *pos, continue; return PTR_ERR(page); } - p =3D kmap_atomic(page); + p =3D kmap_local_page(page); amt =3D size - copied; if (offset + size > PAGE_SIZE) amt =3D PAGE_SIZE - offset; memcpy(buf + copied, p + offset, amt); - kunmap_atomic(p); + kunmap_local(p); put_page(page); copied +=3D amt; index++; --=20 2.34.1