From: Martin Brandenburg Date: Thu, 4 May 2017 17:16:04 +0000 (-0400) Subject: orangefs: count directory pieces correctly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2f713b5c7d2a90baba6c88174c81fb9a96bfde21;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git orangefs: count directory pieces correctly A large directory full of differently sized file names triggered this. Most directories, even very large directories with shorter names, would be lucky enough to fit in one server response. Signed-off-by: Martin Brandenburg Signed-off-by: Mike Marshall --- diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c index cac601498925..d327cbd17756 100644 --- a/fs/orangefs/dir.c +++ b/fs/orangefs/dir.c @@ -135,9 +135,12 @@ static int parse_readdir(struct orangefs_dir *od, count = 1; part = od->part; - while (part && part->next) { - part = part->next; + while (part) { count++; + if (part->next) + part = part->next; + else + break; } new = (void *)op->downcall.trailer_buf;