Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp53824imu; Thu, 8 Nov 2018 14:39:41 -0800 (PST) X-Google-Smtp-Source: AJdET5dy3z/9tmfkL1oA7tX37L7PzufSwlAEpaqnij8rH7ONqEaAMLWoMFQXiJbj8Gp3bZtGr6zo X-Received: by 2002:a63:5d55:: with SMTP id o21mr5285407pgm.92.1541716781167; Thu, 08 Nov 2018 14:39:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716781; cv=none; d=google.com; s=arc-20160816; b=IuXPHbsFUuVoYU5yvE+0IMej+sBCkHVBcYxZxrpszRwSQw6afvVgsvjLKS8PHDJmQB zX6X16mKj34N/PrEnDOPN37miFcmm22ajVPyPEakTVSmVhRnOZAUnWaVdDa0aUUJibhE bHQ2zAENIc8rJVcD6uMIM2kDOb4IopWaKM5vJb095MNLvxkjRraiTs1OJWISNRmiALwo dnxMOfNQkb3816dXa7bn7S08WX4JPWzlzrFEp43qFHMbJAgN7RbrdN6WbHMMwXsQOR46 WAJLoqCvH1VC37NIGmMxGE7wJWR9czBTsMpObjTcVTh5DhG6rB9x1yNt0bTZmOhE9XVT Zfzg== 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=pjGJTJ/F/XpxfCaSCbknt2ojiha14Qc3OgkHb0vAK9o=; b=Dal8aSApdLSsd3jH9L4MZX+fK7kp+CDSaEoySIkro0C0Z+TlDIJHvkiiYHJL94AdT3 TttV29A3sqVrLkmtCE6VqXTha2XvN9NmvflWBz+Hux7YTeHaPR9ioXauwx3Ku5M4XK8/ HIT365fj6SoCTtdc2VSvgukA+qgH6G++joBsCvk1rwQW9ubEBCi5zWyR600zZ5/XfKYk DN5qq7XiCfj+1Inxj7jN+scYWssGKO5D1YwU/l0lAPMmkpwygnfAQnQfs3CLNegzGzRG Qg8f03GsKe7bVkGkztWfondl4WudXv3G1uDOQbHF7tQzuH+FoPvPnfr3wnFVyQadoXBM e0sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FIQXW0dw; 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 bg12-v6si5357988plb.319.2018.11.08.14.39.25; Thu, 08 Nov 2018 14:39:41 -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=FIQXW0dw; 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 S1729649AbeKIHfl (ORCPT + 99 others); Fri, 9 Nov 2018 02:35:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:52666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728279AbeKIHfl (ORCPT ); Fri, 9 Nov 2018 02:35:41 -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 75F1C20989; Thu, 8 Nov 2018 21:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714293; bh=VRaUHSfNGEu9HzsmlARPdRFB3KDqMTY0GELuDWZ09OA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FIQXW0dwITwnq2Ww05694afHs3kGJJqD/UQzj4qDnU2aFD53SSsQDIf9/YN3GYFN5 1YWIntB6ABNxb0yjIPvK/3X0BrI7FFeey1HW1iqECMqtdapwHwRo9okhouvRT9QqAt RUgqJvgwYsKeMUUZgK64R9izaa5YG7h5Z108tDYE= 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 3.18 127/144] fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() Date: Thu, 8 Nov 2018 13:51:38 -0800 Message-Id: <20181108215107.313990327@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@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 3.18-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 08b3db146888..83550ac31f49 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c @@ -684,6 +684,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