From patchwork Tue Jan 25 13:57:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 12723807 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 A822BC433EF for ; Tue, 25 Jan 2022 14:02:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357032AbiAYOB4 (ORCPT ); Tue, 25 Jan 2022 09:01:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47003 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386843AbiAYN62 (ORCPT ); Tue, 25 Jan 2022 08:58:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643119079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jYgB9bHfzimI06W2QhFWyhlriTJczgzjgiDDccLCb5U=; b=GECqZXyGneJRVyypve41/EmBPdOX8eJvzl/K6Zpq+uWDARzWhPevJ+WxGceOb7RtIEn5mo W+QqpXB+aZeZm2ZW7iJqxKCiRUAk7F6UtPOqWs5mShId5KiNtLc/I9n+QeNTkVnakVGmXu DrJT3BBXNN7H5FXxZZ6EAIiFYGBi1Bg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-497-m-ZJYUkzOYm2LaHJM4XvCw-1; Tue, 25 Jan 2022 08:57:56 -0500 X-MC-Unique: m-ZJYUkzOYm2LaHJM4XvCw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0B091923B80; Tue, 25 Jan 2022 13:57:54 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 615C87E11B; Tue, 25 Jan 2022 13:57:53 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [RFC PATCH 2/7] cifs: Miscellaneous bits From: David Howells To: smfrench@gmail.com, nspmangalore@gmail.com Cc: dhowells@redhat.com, jlayton@kernel.org, linux-cifs@vger.kernel.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org Date: Tue, 25 Jan 2022 13:57:52 +0000 Message-ID: <164311907254.2806745.4350376870116513772.stgit@warthog.procyon.org.uk> In-Reply-To: <164311902471.2806745.10187041199819525677.stgit@warthog.procyon.org.uk> References: <164311902471.2806745.10187041199819525677.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org --- fs/cifs/connect.c | 2 +- fs/cifs/file.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 11a22a30ee14..ed210d774a21 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -162,7 +162,7 @@ static void cifs_resolve_server(struct work_struct *work) mutex_unlock(&server->srv_mutex); } -/** +/* * Mark all sessions and tcons for reconnect. * * @server needs to be previously set to CifsNeedReconnect. diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 1cce7e5b2334..24722fe75def 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -4205,13 +4205,19 @@ cifs_page_mkwrite(struct vm_fault *vmf) { struct page *page = vmf->page; + /* Wait for the page to be written to the cache before we allow it to + * be modified. We then assume the entire page will need writing back. + */ #ifdef CONFIG_CIFS_FSCACHE if (PageFsCache(page) && wait_on_page_fscache_killable(page) < 0) return VM_FAULT_RETRY; #endif - lock_page(page); + wait_on_page_writeback(page); + + if (lock_page_killable(page) < 0) + return VM_FAULT_RETRY; return VM_FAULT_LOCKED; }