Message ID | 20231207212206.1379128-50-dhowells@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3821FC4167B for <linux-mm@archiver.kernel.org>; Thu, 7 Dec 2023 21:25:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C88526B00AD; Thu, 7 Dec 2023 16:25:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C10D76B00AF; Thu, 7 Dec 2023 16:25:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFF896B00B1; Thu, 7 Dec 2023 16:25:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9E7066B00AD for <linux-mm@kvack.org>; Thu, 7 Dec 2023 16:25:13 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 79CE9C01E6 for <linux-mm@kvack.org>; Thu, 7 Dec 2023 21:25:13 +0000 (UTC) X-FDA: 81541302906.17.ED70B0A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id C330080002 for <linux-mm@kvack.org>; Thu, 7 Dec 2023 21:25:11 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=McLDmb4Z; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701984311; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WWGWFaVybn+Cuwok82Tqy8Z4Nj/F9zUC0bxWKAhhGjQ=; b=OhvLTsyN2zaYPg7vnd8xpjN5MER8rzANTWYwVRKVLwX3DTW6FvN0to82tXwUf6jmWKv4Rm kXUbOiLI3lihM6/XUW0jVbMVlLfpvD6UfHosihbTrYgJJpi19gedDZLjQtxuntnSSYgATx w1I/M7Z2/WMQVbn8LEIZHznvzdktdtE= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=McLDmb4Z; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701984311; a=rsa-sha256; cv=none; b=z/jY9Z6tdcQ9hsUgyvdsxgfZwY8h9hcWK/ku/v5LKrVAaOOHmjrJX6AojMBty8pJPf1+fD xgGkCvYV27qCJgVhi7LqSOBLaDNMA8R3/55Bq+BcpxVrNw9t67Vj93yA2ieBN7NlelCyKA H14JMN4IIzNsJxkipo5DktgHiaz6lIg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701984311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WWGWFaVybn+Cuwok82Tqy8Z4Nj/F9zUC0bxWKAhhGjQ=; b=McLDmb4Zi5gRMJfnCsUg5HjTkN2QbKQb6jUSOVoTiQpe6aJOYNc1zDR/iAyhNXptDX5/Y4 MEkWKqRtypIwao8W9fMbpIoKVpJUUgn0F6nQryNU0Vm6iHbZ1dE5d7r9gDCv7Pda3yHYyZ M1qwSkZwMmYa48GQw7ZQXvjZDtWUTfs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-436-VvUqiqovNqOjNjOOBY_-Hw-1; Thu, 07 Dec 2023 16:25:05 -0500 X-MC-Unique: VvUqiqovNqOjNjOOBY_-Hw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 645AC386A0B0; Thu, 7 Dec 2023 21:25:02 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78F85111E400; Thu, 7 Dec 2023 21:24:59 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Jeff Layton <jlayton@kernel.org>, Steve French <smfrench@gmail.com> Cc: David Howells <dhowells@redhat.com>, Matthew Wilcox <willy@infradead.org>, Marc Dionne <marc.dionne@auristor.com>, Paulo Alcantara <pc@manguebit.com>, Shyam Prasad N <sprasad@microsoft.com>, Tom Talpey <tom@talpey.com>, Dominique Martinet <asmadeus@codewreck.org>, Eric Van Hensbergen <ericvh@kernel.org>, Ilya Dryomov <idryomov@gmail.com>, Christian Brauner <christian@brauner.io>, linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French <sfrench@samba.org>, Shyam Prasad N <nspmangalore@gmail.com>, Rohith Surabattula <rohiths.msft@gmail.com> Subject: [PATCH v3 49/59] cifs: Set zero_point in the copy_file_range() and remap_file_range() Date: Thu, 7 Dec 2023 21:21:56 +0000 Message-ID: <20231207212206.1379128-50-dhowells@redhat.com> In-Reply-To: <20231207212206.1379128-1-dhowells@redhat.com> References: <20231207212206.1379128-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C330080002 X-Stat-Signature: uhydsyouehkcmi67ndq1jhcdqx3ms4ck X-HE-Tag: 1701984311-797615 X-HE-Meta: U2FsdGVkX1/X0cw9CHIO0/kJ/LJOsmrTZmZ74cbRqfHB7XwsxsmYSW9A/WTIC1RfNOVVrH69/lj5jNXe2UdYWPiQPHQCSFv7Fsw1uYGawZikjWFv8j5qRD6B42x0JkKUFaQnMzxmlO0eL+9f7dVOra7vZkVwYOTkbgd48UNR/+ASC+R4yeD4EZOaAElTVsu7QhDpuPGrxv09YRNE4UtQAo8pxM++VU8kdL2QIfWmT1RunzKs7tS+1rllVkvnz1SmqYPCcGJ0fEqcv6zq9DxoAejK0+6CXC2ZYeJqOTtvwDoP2FcKxNxWKhJrfefOxOdoCroyWU1nWZtDAhbPS6LyuWLsNAvjUW5+OD6MhATGPbnvxQ8kpEzTGrrdOkcmYeAowf/WkQQXB0a1AhRwRSCQKF+iE5q9JEFgLhYjwPrT3+MkPhfztG2netWFow6ixDcKyyoctpVDwgbIX07HrC02wQhOANmw7Lu3rda8gpDbTrKrX9GYeq1NVPGB7Dc0IPEJFG3tzF1KIbg695ZbYaqwXefcsgSAWrw/CCjMD/OraK+jN90wcMe4fHkFnDPIiNHpRMrE6dqv0TKH2AG5Gkn8xL1PmiuJM+O+uoBj7uf9IzsAYKFPkqXTdHDX3Kdv6cpzcZmy79AUlpOAhMnGaEAkGMnjuMM4OKwoZQVPdSXK6eRs8/YFV0qg/NB0+ubHIWKsrAZGa7EVs01hQwTkyxJU0XL4pK/vG6vF66QK3MuxIaIV4WngxJxBCio79bEeEdmqVUH3XgbhzG2HMPSOcWBhp2y289jSmr2OEZ/Rf6VWH8aluuqqs9DhRRwjca6hF2SYXUx664Ju96Q5k2I/JoAuBUEIMknjy3lq4kETFLh98dozZm2KGJtZRwqMWMTYS8N96NxyMb5/8CBJMSvWuIthgEqUlvhJmzGktMHh1+ooP4zSu6FNE0jg42nAawzbdxLpq7G5DiePybv7zfk9FgH DdkkR+jo OzqoNre2Nhvz34zEQNFTCT0is9UEO5nNTx7+WzcXSAlveCHwc40VKGa3kX+wsgpPTJvj67c+fzH/jXfeQDJTMfMqLO8NGWcqhA4xrdjGthewOo0nksQgDvPi+bl9rK+I8d9V+R4HtU2Ef+vhe8uHzPfltSk9toNE9x79HY8BaeixqwdDTKHTkrxlCuPrA6TVFRn7GTvc04oyTrbWFEZzPiUTHcp9JodHLdeb9oJR8HYNKkk5kTbHStotIDgWQibXu0xSSeary61l89XgxRKZaeHbIYSjjDQYPy0+8No7s2ZfcZn7lk6tlOcL+nwx0Wl7LY8kVg6caL9qOlFeNg6/hoCNgGw+PP6bD+DDkLUgkXPoB2QfYkovqpD6i67Odauy3VL31OsGdmJGkd2O3jgAZ6heGLPJwyAjNkLbm1Belj4ZTlHBMPAU2EmncE6iFdHHwXDJ4wSEqheP/NOthLbm4KudoNGWeRyL5lQylEZ57ImT8Ui3BCMsM2lN+ig== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
netfs, afs, 9p, cifs: Delegate high-level I/O to netfslib
|
expand
|
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index 078cff36cd2e..ebe04c78a955 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -1337,6 +1337,8 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, rc = cifs_flush_folio(target_inode, destend, &fstart, &fend, false); if (rc) goto unlock; + if (fend > target_cifsi->netfs.zero_point) + target_cifsi->netfs.zero_point = fend + 1; /* Discard all the folios that overlap the destination region. */ cifs_dbg(FYI, "about to discard pages %llx-%llx\n", fstart, fend); @@ -1355,6 +1357,8 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, fscache_resize_cookie(cifs_inode_cookie(target_inode), new_size); } + if (rc == 0 && new_size > target_cifsi->netfs.zero_point) + target_cifsi->netfs.zero_point = new_size; } /* force revalidate of size and timestamps of target file now @@ -1446,6 +1450,8 @@ ssize_t cifs_file_copychunk_range(unsigned int xid, rc = cifs_flush_folio(target_inode, destend, &fstart, &fend, false); if (rc) goto unlock; + if (fend > target_cifsi->netfs.zero_point) + target_cifsi->netfs.zero_point = fend + 1; /* Discard all the folios that overlap the destination region. */ truncate_inode_pages_range(&target_inode->i_data, fstart, fend);
Set zero_point in the copy_file_range() and remap_file_range() implementations so that we don't skip reading data modified on a server-side copy. Signed-off-by: David Howells <dhowells@redhat.com> cc: Steve French <sfrench@samba.org> cc: Shyam Prasad N <nspmangalore@gmail.com> cc: Rohith Surabattula <rohiths.msft@gmail.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cifs@vger.kernel.org cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- fs/smb/client/cifsfs.c | 6 ++++++ 1 file changed, 6 insertions(+)