From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59936C282E1 for ; Thu, 23 May 2019 19:50:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 336252133D for ; Thu, 23 May 2019 19:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558641020; bh=5J9r7WqGNFJ/CSado9t/MekUwvyPZF1ABsZJ4qFD3k0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ek4Hb6VDjfhOCURBpm0HdPH/yjSKRfixeQLApcxMVO9hgso+UtMa+3MDGlC13vM0D ZFzhECJzrgvvJfbUZ9rD5AYsbMkbKGhlmwUm3KEa/F/l0LRFQPcDeHLF9LVOrmX41C GOY7Mk5itcEWOjFVnnPKR6QIWkHBNU0gQ4IlucPQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387654AbfEWTKD (ORCPT ); Thu, 23 May 2019 15:10:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:43346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387650AbfEWTKD (ORCPT ); Thu, 23 May 2019 15:10:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4AA3F217D7; Thu, 23 May 2019 19:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638602; bh=5J9r7WqGNFJ/CSado9t/MekUwvyPZF1ABsZJ4qFD3k0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m9Q+hA4+8WomfXkNyotfwFJiVYwExZhQPlQiBSr9SZm6RhlXxHRkrPi8x9VgWoZAC 72JdkohjTjyEA7PQFRJ9CyG8oUejuIBppoO44hZ7qv8nmtR6FN8vp5QgW4F/nNzZu6 EjkWk31u6BDywuzJzHWoy/8F2vwytR22P9FA89Zg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Layton , "Yan, Zheng" , Ilya Dryomov Subject: [PATCH 4.9 23/53] ceph: flush dirty inodes before proceeding with remount Date: Thu, 23 May 2019 21:05:47 +0200 Message-Id: <20190523181714.509534943@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181710.981455400@linuxfoundation.org> References: <20190523181710.981455400@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jeff Layton commit 00abf69dd24f4444d185982379c5cc3bb7b6d1fc upstream. xfstest generic/452 was triggering a "Busy inodes after umount" warning. ceph was allowing the mount to go read-only without first flushing out dirty inodes in the cache. Ensure we sync out the filesystem before allowing a remount to proceed. Cc: stable@vger.kernel.org Link: http://tracker.ceph.com/issues/39571 Signed-off-by: Jeff Layton Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov Signed-off-by: Greg Kroah-Hartman --- fs/ceph/super.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -742,6 +742,12 @@ static void ceph_umount_begin(struct sup return; } +static int ceph_remount(struct super_block *sb, int *flags, char *data) +{ + sync_filesystem(sb); + return 0; +} + static const struct super_operations ceph_super_ops = { .alloc_inode = ceph_alloc_inode, .destroy_inode = ceph_destroy_inode, @@ -750,6 +756,7 @@ static const struct super_operations cep .evict_inode = ceph_evict_inode, .sync_fs = ceph_sync_fs, .put_super = ceph_put_super, + .remount_fs = ceph_remount, .show_options = ceph_show_options, .statfs = ceph_statfs, .umount_begin = ceph_umount_begin,