Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2048270ima; Mon, 22 Oct 2018 03:23:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV63V5LkxKmk9FO14OohBRZH3aW+iDgca9btAtqnz7SKx4J4+GGYKFD+6HW/ofIRcxLhe7dWs X-Received: by 2002:a62:13cb:: with SMTP id 72-v6mr44318085pft.34.1540203810644; Mon, 22 Oct 2018 03:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540203810; cv=none; d=google.com; s=arc-20160816; b=JADrVkT5kbQNyMp1Jfun8M7W7H43pYrWgeKJ/wgqwqrcTfovqwtIVGb6qWHrerf7Hw zh+57i9ElFUJLDHyzl/88LnSuSMfoUWgSULG9/At4TT4s6eylE8VCh3cmcPyprBC2Oqo 9QCipyQxwGk/Mf1uCslKNjL4CLEKqkq6gtVnR/RfuNyRhIQuibMnn+IYxAoOVW6dOGe/ Q2qUx4S1HYwPNXca3C3AdIIQk+Rfz6hBiCCLa8vHEVuP13IFAXl9QvZ6IHuRoUh1jBSK ooGwNw3Plw0zHmMmlBU0e0wK1Px00+O+bcrD24S9/g9n1BiG5AE4L3OKX1aN8vgUTYHD unUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=RRsHDf0d2d3HH2eV56PpPRSREae0mvo4S7+6rxOSCLE=; b=LIgwcREKOcgSXxqFKjTWy6/0/H+cjja5q9grB5hG8bDj1YNvIokOZ2adgGTQn2wryW bdzP+sWOSA9Hyhsx4kAy3Vf3NpO5m4XBY0wE4acXafxu6Y2ra9WYl3642trV7HAq9a4d zNklgKE2ID8tvrPzaV+8v2gP7sUEkE51P/QHqCeTzY4V6TUQnbtsK2PaOCdILRn4LF4w ZwS3pHIGWCEhpBvN+ROkrF7yXVPJJVfz7c/BcuHtatEQ8Ar/Kz+BdwgvAy4FdAaNhysh okdBKXA+e9fmdv3xI+hVo87X0rESRtLVmU9TDUrY8bAHK+CF6MfEvxcNwNJf0F2KIxlg JWPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aR73hZ+T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u15-v6si4219420plq.418.2018.10.22.03.23.16; Mon, 22 Oct 2018 03:23:30 -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=aR73hZ+T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729211AbeJVSi7 (ORCPT + 99 others); Mon, 22 Oct 2018 14:38:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728591AbeJVSi6 (ORCPT ); Mon, 22 Oct 2018 14:38:58 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C7BE2089E; Mon, 22 Oct 2018 10:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540203663; bh=1MUhLQ1ytDUNuMNOkQCcrmmzWWtJabFUjfIoKRtexfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aR73hZ+TKj+OwJmR5gWWAknRrmlnOAmuugYKCnT6uo0G4LtVLUtJwZbQg0YJX8prA PMTf9kcvzTs/C/TiJpMs8UIwLWXDQiaNHuofkmZjnT4U5JlH/cVAAFAeOzaxZczhL3 m90mlZ3hXmwOfbY7+PFWO/WVhWIXSDVW/DaHzYN8= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Khazhismel Kumykov , Andrew Morton , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.14 15/15] fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() Date: Mon, 22 Oct 2018 06:20:26 -0400 Message-Id: <20181022102026.40869-15-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181022102026.40869-1-sashal@kernel.org> References: <20181022102026.40869-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Khazhismel Kumykov [ 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 a40f36b1b292..9635df94db7d 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