Received: by 10.192.165.148 with SMTP id m20csp2528996imm; Sun, 22 Apr 2018 08:56:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx49O2zSLrywUDwYMonOA668hW+3/+An6qzy9iZq40eTU7mXa1QQMfZKgsYGXPGgbK2GjUka+ X-Received: by 2002:a17:902:2f84:: with SMTP id t4-v6mr18196572plb.24.1524412616003; Sun, 22 Apr 2018 08:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412615; cv=none; d=google.com; s=arc-20160816; b=cKEbKJcUhJIM+C/O0rVj6WEZz782ElZ5ooGg9g52EGRZ5HsNbKZv3dIblCSugblApg CcX76ZlOMNWSVaN7KGlBBcn8yYJK4PS/YcfFOIX9hadOVPMKdpK7kroVeEgsEKjZrGuz diidwBIic3dZSKbcl7vNPp9eCm7QiQtsPQ3/tKp/nte8AkNImsCqMJeZccKveYyHWkDl ikjsenGGYAsekzCgz2UcwXwhGE4NizsRW2JGi5M7bMk998YAQUFAVORPWFdPdF35oxYZ rD/KcBuiseQmXzIQ+7DsUlbpg/2ZyvbPU4Cf08P/6txWcUcW3SpNW3ymqQQIvHMDiNdr Qr4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+wu+htEJc56IAHtqghAdLDbOnDspHpA7GDloDIMgSt0=; b=zDaCAwJPCCpf5CBJZ4eMNFvnhWjAhvsCuNe7UrNGiKIR1Z0F4E6catc3TDG21etGwB 96bAMJh8QtQ6T32F/yQpIUpZ2v4YeRweCHCAuQAb0Z/0lSnCPBHjHcsg6UwWJ2TDkGKy GgUL7scr6FA6QAbHzYe2xM6HAzvkl6KBlzZu2ZnKRuyi3K8yi3WveUi9ZJFJBMryq3yl O7Wm3Y2xf6+fLU8zpDCLxlhe0tcOPIdEA9NbUCvNZPmd3DTA7uJwiCBae3d72lHSv+ZP smHu34h6jA2scq5L463UGPMGrFcYsfJhm4wW/Q6YPCBkHkxi8TZbYLcusVKOd9ukukHd 7rWw== 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 w12si1233870pgs.183.2018.04.22.08.56.41; Sun, 22 Apr 2018 08:56:55 -0700 (PDT) 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 S1754610AbeDVPza (ORCPT + 99 others); Sun, 22 Apr 2018 11:55:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47028 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754408AbeDVN7n (ORCPT ); Sun, 22 Apr 2018 09:59:43 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 91ADA92F; Sun, 22 Apr 2018 13:59:42 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso Subject: [PATCH 4.16 086/196] ext4: eliminate sleep from shutdown ioctl Date: Sun, 22 Apr 2018 15:51:46 +0200 Message-Id: <20180422135108.748190074@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodore Ts'o commit a6d9946bb925293fda9f5ed6d33d8580b001f006 upstream. The msleep() when processing EXT4_GOING_FLAGS_NOLOGFLUSH was a hack to avoid some races (that are now fixed), but in fact it introduced its own race. Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/ioctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -497,10 +497,8 @@ static int ext4_shutdown(struct super_bl break; case EXT4_GOING_FLAGS_NOLOGFLUSH: set_bit(EXT4_FLAGS_SHUTDOWN, &sbi->s_ext4_flags); - if (sbi->s_journal && !is_journal_aborted(sbi->s_journal)) { - msleep(100); + if (sbi->s_journal && !is_journal_aborted(sbi->s_journal)) jbd2_journal_abort(sbi->s_journal, 0); - } break; default: return -EINVAL;