Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2457211imd; Fri, 2 Nov 2018 11:44:00 -0700 (PDT) X-Google-Smtp-Source: AJdET5fQTpRsL4te+JmrZZkMq/xRlCdrKBUcAi7Zqfq/W5uQv1svGf9AIjfvIBMjQmMuXdLv+7gP X-Received: by 2002:a17:902:5a43:: with SMTP id f3-v6mr3887747plm.57.1541184240712; Fri, 02 Nov 2018 11:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184240; cv=none; d=google.com; s=arc-20160816; b=NqgT4OArq8ySFydwM4tSqsPTqgOGm6u7KhWLxQLiaT/b/UYDtrCFKQcZeuZWwBuQAS 6mZ1P4iux9V3ukiaflu1HDxfIX7BHKZAO1nfHNi7qdOuxVrT6zmqoN2GgzO7dU4Q0mVG iC6N3zQK6QJuqz5kkXdXiHdhapOEV2uyyJzaiJkzwhI448XSv5w+JjFEKhuTbf8mQ6CC XOq64yf5nHDdLSdAl2kDNDA6jCKi/C69ps6s7ePnjdP5lTC0XNViaVWgxp92hQ1nXBRl XKXtiE9IIayPybL2jvMeNhVRlDX/RWqS/iZ45/IX0wRrAUbtaCb1phAV24vnC18rogIb 9DWA== 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=yzBkLR1Db3/VKMSVZtaiH3pQ6V5++Z/n/xk7uBPA+/U=; b=M+lmLSTal0ieeZrutPjeJYweOBo2p1sHM9Of06E+Vz7Vpm78yrHNG96cNO6J8HGLom YWnxznhOR+/6klFQPlZ4EZKT1+4dhD64bhXTvLoakazHcpyQmdGJ17H83mCrBkyr890c 20zvWBuavZxwd44U4AWmBl1p5F0qUOylChBVbdCGc3cZ0dmJaqM2cdVzsCrb/+zQgO6N EDsmx+G84M6Uc0bWHweoaNPUOxiaX/EWQ4K80YMSkSiyPOUutw8dPWYvSsbBD1aZ+P2o 33PNGrbpt2T/X1bgZ0wgrmO4BXWpIaOK9BDkXjkQnSk4Y7SgBn2Wjfygdtam/AdA6Ho4 DmLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ILCojGky; 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 h71-v6si23880805pgc.122.2018.11.02.11.43.46; Fri, 02 Nov 2018 11:44:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ILCojGky; 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 S1729850AbeKCDu4 (ORCPT + 99 others); Fri, 2 Nov 2018 23:50:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:46074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728033AbeKCDuz (ORCPT ); Fri, 2 Nov 2018 23:50:55 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.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 858232084A; Fri, 2 Nov 2018 18:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184163; bh=QGlC5bGiuGuvYiu043agKkj4LXuJIBCsI3bh0+t2Uuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ILCojGkygKzOGLEWGwyycun303yGV995B27JYXtiGGI1ERD/FuCN0cyc4nE3jOsuc bi7uoahteHCeofr+q5k//LYtwP45VulTd/XuY+BhUjQkVfzOG8cScYX3R32Ysb6fgX aaoxgBBcZgohWqGWSHduPZ0c+S3EWUJG8YO5dp3I= 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.18 099/150] fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() Date: Fri, 2 Nov 2018 19:34:21 +0100 Message-Id: <20181102182910.288113111@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@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.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 3aef8630a4b9..95d2c716e0da 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