From patchwork Mon Apr 22 02:30:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Ruffell X-Patchwork-Id: 1925954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VN8PN4T0wz1ybF for ; Mon, 22 Apr 2024 12:30:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ryjS4-0002xR-4H; Mon, 22 Apr 2024 02:30:40 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ryjS2-0002wf-Vo for kernel-team@lists.ubuntu.com; Mon, 22 Apr 2024 02:30:38 +0000 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id C0D993F182 for ; Mon, 22 Apr 2024 02:30:38 +0000 (UTC) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-5f0382f688fso3705416a12.0 for ; Sun, 21 Apr 2024 19:30:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713753037; x=1714357837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XU5SL/T0eXoDM+B3o/cILShkUDjr5tEdmghLpGv8TXY=; b=RemXSqFN2Wv3lGW+yXtPj6Oww6SZJ9XodMBTqMANBfSta1MC/j4K+JQn1mrefMJ1qD pC9pVcJCXZEzB4OKIa11Si3gIiZS8Lf3LWFcKp8jxUOT27Ge47brtGHNLcsHC8+2ATXr LeKC+jnRAxI4gTDUrVMwTctK01zdaMvGmfP4AUWDdVaNl7UXm/uzZaP0Fw40lIAN5FOm iLvjseB7uVJOzgF2tSrTkY5ZzNJog95pTSHGf+XAq34aMV1mRHZTkihAbTS0uCiUgJ51 CWITuX1A75gwesEUr1zu5PKV1i/tdzArHx0sHx+ybUU9bTapRzwmB91Pd1VwoDA+KX2g QAvw== X-Gm-Message-State: AOJu0YwaHNWQVU8xWy23Keu29ZCsYNuxbQAj7nVhEzQp1Gd/7o+I637u 2ehP2rgDWEzcm7WiDh7GFvnOUSZIxPgoAQK/TOXGmdmwrUb+HU0H4+8ftVvhnWgrRncqGNFKpFw IIMT+zuO4R4Bl0GnGV1d6HSicxvP+vOefb3OFRn2FISDcBlrGP0m5kVfYuqBhTCR+rgxo9nyN2t HFMD0PWAhrQw== X-Received: by 2002:a05:6a20:3b83:b0:1aa:58d9:18fa with SMTP id b3-20020a056a203b8300b001aa58d918famr6637319pzh.48.1713753037429; Sun, 21 Apr 2024 19:30:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjtmKAqCAR8fsIKkz3w7/BSwk5BF49kUWIa+5lRvNhSsTPphjSpUa2GKogwbcNki70QGbEfA== X-Received: by 2002:a05:6a20:3b83:b0:1aa:58d9:18fa with SMTP id b3-20020a056a203b8300b001aa58d918famr6637310pzh.48.1713753037139; Sun, 21 Apr 2024 19:30:37 -0700 (PDT) Received: from ThinkPad-X1.. (222-154-76-179-fibre.sparkbb.co.nz. [222.154.76.179]) by smtp.gmail.com with ESMTPSA id ei16-20020a056a0080d000b006ed06c4074bsm6762455pfb.85.2024.04.21.19.30.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 19:30:36 -0700 (PDT) From: Matthew Ruffell To: kernel-team@lists.ubuntu.com Subject: [SRU][mantic][PATCH 1/1] UBUNTU: SAUCE: Revert "cifs: fix flushing folio regression for 6.1 backport" Date: Mon, 22 Apr 2024 14:30:27 +1200 Message-Id: <20240422023027.21592-2-matthew.ruffell@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240422023027.21592-1-matthew.ruffell@canonical.com> References: <20240422023027.21592-1-matthew.ruffell@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2060919 This reverts commit 21bb2ba4f1ac1e3a57594be62dd74e7b1401b2b1 (ubuntu-mantic). __filemap_get_folio() works differently in 6.1.y where the patch was initially sourced from, to mantic's 6.5 kernel. In 6.1.y, it returns a folio or NULL, and in 6.5, it returns a folio or negative error code. With this applied to mantic's 6.5, users would see page faults when attempting to copy or write to a file from the same directory as the source. BUG: unable to handle page fault for address: fffffffffffffffe ... RIP: 0010:cifs_flush_folio+0x41/0xf0 [cifs] ... Call Trace: ? show_regs+0x6d/0x80 ? __die+0x24/0x80 ? page_fault_oops+0x99/0x1b0 ? kernelmode_fixup_or_oops+0xb2/0x140 ? __bad_area_nosemaphore+0x1a5/0x2c0 ? bad_area_nosemaphore+0x16/0x30 ? do_kern_addr_fault+0x7b/0xa0 ? exc_page_fault+0x1a4/0x1b0 ? asm_exc_page_fault+0x27/0x30 ? cifs_flush_folio+0x41/0xf0 [cifs] ? cifs_flush_folio+0x37/0xf0 [cifs] cifs_remap_file_range+0x172/0x660 [cifs] do_clone_file_range+0x101/0x2d0 vfs_clone_file_range+0x3f/0x150 ioctl_file_clone+0x52/0xc0 do_vfs_ioctl+0x68f/0x910 ... "cifs: fix flushing folio regression for 6.1 backport" should have never been applied to mantic's tree, thus we revert it as a SAUCE patch. Signed-off-by: Matthew Ruffell --- fs/smb/client/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index 55a6d0296ec8..82313b253463 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -1245,7 +1245,7 @@ static int cifs_flush_folio(struct inode *inode, loff_t pos, loff_t *_fstart, lo int rc = 0; folio = filemap_get_folio(inode->i_mapping, index); - if (!folio) + if (IS_ERR(folio)) return 0; size = folio_size(folio);