Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp47311imu; Thu, 8 Nov 2018 14:31:36 -0800 (PST) X-Google-Smtp-Source: AJdET5eHoAUYPewlc+8Vtn/LUOeYHr550ecbpufqfg4Cx0R8uNDuVjnTjikiWUkA81CHWO1bMhou X-Received: by 2002:a63:c846:: with SMTP id l6mr5251005pgi.78.1541716296102; Thu, 08 Nov 2018 14:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716296; cv=none; d=google.com; s=arc-20160816; b=kyxcDe8NZtNyXfPePjWnWDpDEjXOMP/eJVU2DC4I9OI5OpiRU3VJH4Xr94Vl8yLxUO vtNk2QhclG3mGjEkpkvQR2qfRH46wI/GQGqI6oli0vLKbnufbvn0teV4zU4eFpL5eTcB 9BqoIfDZwSln3gWbChHzwHu4SEgRXImuGBYuYnV6dUlUr09cso1gNqopXk49ypF/vvcb u6FGIbSXYwlCGs2yoI+qKB45Fhlop8cJ6a2tq7WSZkIjepou04Crlu5yUCxX3wYSQL0v KxTv9y+L2dsIL/igY2i6i9Hf7Y9e4vRz+eLfsyFp8Hgn+5RE+HikXfB4dkRntEq7E3kq Gicg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jQvYtF41c+yofV9NGlQj9G+uJwT3QBDMY4QMIH1brB0=; b=BZJ0FGSrZ5yXXp49Hnioz9ePd0Y2Ke3MyaduH+efHCG76PZ64tapaqab8WGXrjxA83 GjONayXCEbwhmDJ/1mBfFUyz60duI6+PKSlVIaq9Lreyu508qwIfbV63GTNI15nXgIH4 wKeVtH64Gu0AvHIJWP25fLVhsxJ5gusy95UXa9fdP9WoviYkPMxvYxyKKrFDzv6Ey0S8 z6AfTDUGgkmkHYWxKCCjIe5LcfvzaGBdQsxj3CIKhbqFXwB1ZwC/xa2dDhNR4qFDEJla CUTtJfJuor5mkF0FkptVzBZM/ipsybXKQMucbLhNpge/wqqILNdQ7bfGNigY+PtstRvs 7giA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x1aUjtkG; 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 a5-v6si641099plh.157.2018.11.08.14.31.20; Thu, 08 Nov 2018 14:31:36 -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; dkim=pass header.i=@kernel.org header.s=default header.b=x1aUjtkG; 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 S1730542AbeKIHh7 (ORCPT + 99 others); Fri, 9 Nov 2018 02:37:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:56748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728087AbeKIHh6 (ORCPT ); Fri, 9 Nov 2018 02:37:58 -0500 Received: from localhost (unknown [208.72.13.198]) (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 BCFEF21486; Thu, 8 Nov 2018 22:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714429; bh=vWXYxW6rLybB5hXWFkZjk7QfxoY4f6DLbC29RjUGxaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x1aUjtkGTJl80vvRTDbwn9GdoNst3BgYpIb/ywjRXFthcDRqgekwhk3Zt+ovB0aCD H5RqUZ/XyCvPsgebGgej0o6RkQFvWAxiVmZF5iuJ96LxEb3uswL6aqgphmaGVlBori T5v4unLSe17xGuIUVjxZ0AKRwrC18juVARrTrEGM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Khazhismel Kumykov , OGAWA Hirofumi , Andrew Morton , Sasha Levin Subject: [PATCH 4.4 085/114] fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() Date: Thu, 8 Nov 2018 13:51:40 -0800 Message-Id: <20181108215108.594146350@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ac081c3be3fae6d0cc3e1862507fca3862d30b67 ] On non-preempt kernels this loop can take a long time (more than 50 ticks) processing through entries. Link: http://lkml.kernel.org/r/20181010172623.57033-1-khazhy@google.com Signed-off-by: Khazhismel Kumykov Acked-by: OGAWA Hirofumi Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- fs/fat/fatent.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index a70e37c47a78..e3fc477728b3 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c @@ -681,6 +681,7 @@ int fat_count_free_clusters(struct super_block *sb) if (ops->ent_get(&fatent) == FAT_ENT_FREE) free++; } while (fat_ent_next(sbi, &fatent)); + cond_resched(); } sbi->free_clusters = free; sbi->free_clus_valid = 1; -- 2.17.1