Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2980816imu; Sun, 9 Dec 2018 14:12:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/V7OxxrMpyxRVpzUaQMJnD5ApK4wcdH9aOajO3WldLy8EN54b6aW84koPu9SBg4eYWG53Fr X-Received: by 2002:a17:902:e18c:: with SMTP id cd12mr9305167plb.279.1544393547926; Sun, 09 Dec 2018 14:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544393547; cv=none; d=google.com; s=arc-20160816; b=eRP+QVEO0F3AbpJ+GsrqjXAGmRA0nFHoRwzkNxcp7Ib7ZywJg1ZF9M7L3JLIn9G2iD /zvmefNehV0CUPaR7BsWqlUy4iuT/xc+ZYCZ4xggEYD3A/hM9lprRDta/ZAuFgOi+dz+ fqXHHP37fKzWOcuDzqK/z51Pkiq1NS7TjCTjGLUqItr/PEt9e0VWI8cGkd4r+4lDAaeM DoeZwZV3GgZg5gJhlvpHHGCSImgsAV1p3RoJO+8Qv1FFbZk9JB5/HteNtaz0xtMWBP6x BnwsBt+OXVeYu31F3NoO0sm10C7EgswWjVfXuNlPchaO4GLiu9+In2RCjBGfTR86ZMxA x8jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=NOpGh3K9TEl4Jf28v/bVEFDpWLYVKMeri3PRygVVjLg=; b=sTZBWgTNb+wv8laK4fPb1X5voWZSpQ5p2+sBwgWWo/dluaDjqRCchaevnKX8rutZDy hmJ/d7cTlFFcmltY4Dp7HLcE/NeawUVdCC+v0CYSe7qkE1PsG0fumYZcAQfLLxTZIfuA yuJN59BlKv3eaMIla4vSwbLVVx/RKGLPiOtfnaEkRKL4qYUB3iYLmKxA42QIT6sYt36j 8iJ1LVSv+/9q6sbAUgajItYt3wAnP/7E5E+n5LKhAfCbGIErIp2TrOxXbZXg7D+QxEGK C/wWdGJW0KeouhqjtGbsgVmJNwtb3KpK4czdPRCqkeFTRAwZe+y+wqaOh4PWGhXBb93v 2QEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si8811707plx.391.2018.12.09.14.12.12; Sun, 09 Dec 2018 14:12:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728109AbeLIWJr (ORCPT + 99 others); Sun, 9 Dec 2018 17:09:47 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:37466 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726314AbeLIWJn (ORCPT ); Sun, 9 Dec 2018 17:09:43 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW73L-0002io-IL; Sun, 09 Dec 2018 21:55:55 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72a-0003Hu-Mh; Sun, 09 Dec 2018 21:55:08 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Miklos Szeredi" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 072/328] fuse: flush requests on umount In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Miklos Szeredi commit 580640ba5d331eb5631a5de46941c98f5ed90886 upstream. Use fuse_abort_conn() instead of fuse_conn_kill() in fuse_put_super(). This flushes and aborts requests still on any queues. But since we've already reset fc->connected, those requests would not be useful anyway and would be flushed when the fuse device is closed. Next patches will rely on requests being flushed before the superblock is destroyed. Use fuse_abort_conn() in cuse_process_init_reply() too, since it makes no difference there, and we can get rid of fuse_conn_kill(). Signed-off-by: Miklos Szeredi Signed-off-by: Ben Hutchings --- fs/fuse/cuse.c | 2 +- fs/fuse/fuse_i.h | 2 -- fs/fuse/inode.c | 16 +--------------- 3 files changed, 2 insertions(+), 18 deletions(-) --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c @@ -415,7 +415,7 @@ err_unlock: err_region: unregister_chrdev_region(devt, 1); err: - fuse_conn_kill(fc); + fuse_abort_conn(fc); goto out; } --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -804,8 +804,6 @@ void fuse_invalidate_atime(struct inode */ struct fuse_conn *fuse_conn_get(struct fuse_conn *fc); -void fuse_conn_kill(struct fuse_conn *fc); - /** * Initialize fuse_conn */ --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -376,27 +376,13 @@ static void fuse_bdi_destroy(struct fuse bdi_destroy(&fc->bdi); } -void fuse_conn_kill(struct fuse_conn *fc) -{ - spin_lock(&fc->lock); - fc->connected = 0; - fc->blocked = 0; - fc->initialized = 1; - spin_unlock(&fc->lock); - /* Flush all readers on this fs */ - kill_fasync(&fc->fasync, SIGIO, POLL_IN); - wake_up_all(&fc->waitq); - wake_up_all(&fc->blocked_waitq); -} -EXPORT_SYMBOL_GPL(fuse_conn_kill); - static void fuse_put_super(struct super_block *sb) { struct fuse_conn *fc = get_fuse_conn_super(sb); fuse_send_destroy(fc); - fuse_conn_kill(fc); + fuse_abort_conn(fc); mutex_lock(&fuse_mutex); list_del(&fc->entry); fuse_ctl_remove_conn(fc);