Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15754302rwd; Mon, 26 Jun 2023 00:25:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73VFosDpLDe3T+RzXOEf9qtHeX8MFRiMLemS35ZL9KJO83GpZPpc5aaVTRhj/JzNpJLBxF X-Received: by 2002:a17:907:928d:b0:977:eed1:453c with SMTP id bw13-20020a170907928d00b00977eed1453cmr23859123ejc.73.1687764333432; Mon, 26 Jun 2023 00:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687764333; cv=none; d=google.com; s=arc-20160816; b=aVKCCr++UktrNmjBBZcIa2Z6zhSU8fOAokz/4e0dNomdRKZ+LvwhpVhYVUM8sny2XX xHzI1M7OehY/0ZkD2Mq1Mqcxn+BX8OqJqVBgww18LdRDl/88QDlz5DksJ0o27ZLrseQK Ii+M+UtomwLK20k0DDdh6m2FV68yc+OOcNRycJK8ejR+jOwmaUA6z3Zohb764PpEE/X3 pPPlLouZ38A24r7uc4zm09zz2s2iWX0WchtxgDBAfKL7zhOsMHcBDvViPbwWiVR7B7+P 6JVxo9HZnHEic7VsIY+alVliG/hKumVUy4xUkdi11dPWqsIfmqQKwOFDGUGnVCmza/dX WKmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=RVEVx49mxNIII67NO2PpPsiMVgXqHBi6kJxlBTilANo=; fh=2/OepbD16sII06AHmQTJgD7xcw2OMNoUEY9t7KuTeGw=; b=yGImwq4UeV8Fh9U9JzJuY8sRGo1wfvEfmOw6uTYo3bFU//dJJuHXrVKdaY4aY/fIgc 6z+Bd70VxnziwWu3D3CCV8XkuR2Zg5Unxva6R/vijOsxKAgwOedVuo3ycp0oTEwrXXBH UT2Gd+6ApdTDgbecApnJ75d/vbdunk9jI/ll5RY82KNv7LbgS4xylvAM1FHnucEpK33S KordWAdolx7feKm48XFDPNlLsvmhR+gZqKc0hCcJ9g1F7xD7LXWT60/UrV+MTd7tFEj+ MKI/j0oFNjqb4WuQT0DFrL5gfglSHy5k2RlJ/KOQZm0J+akVXzB+rP1ixh+QBO1/cXTm CMhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=PRpAQuq9; 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 lf4-20020a170907174400b00974d5805d22si2487985ejc.727.2023.06.26.00.25.04; Mon, 26 Jun 2023 00:25:33 -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=PRpAQuq9; 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 S229636AbjFZGva (ORCPT + 99 others); Mon, 26 Jun 2023 02:51:30 -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-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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 testing 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 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, 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); @@ -498,12 +498,12 @@ int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, continue; return PTR_ERR(page); } - p = kmap_atomic(page); + p = kmap_local_page(page); amt = size - copied; if (offset + size > PAGE_SIZE) amt = PAGE_SIZE - offset; memcpy(buf + copied, p + offset, amt); - kunmap_atomic(p); + kunmap_local(p); put_page(page); copied += amt; index++; -- 2.34.1