summaryrefslogtreecommitdiff
path: root/fs/orangefs/dir.c
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2017-05-04 20:16:04 +0300
committerMike Marshall <hubcap@omnibond.com>2017-05-04 21:38:24 +0300
commit2f713b5c7d2a90baba6c88174c81fb9a96bfde21 (patch)
treef478c82f55b45d134f25c7ea99ad5bb6d06d3620 /fs/orangefs/dir.c
parent942835d68f6e16f2673c70791dc963c548681cb4 (diff)
downloadlinux-2f713b5c7d2a90baba6c88174c81fb9a96bfde21.tar.xz
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 <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/dir.c')
-rw-r--r--fs/orangefs/dir.c7
1 files changed, 5 insertions, 2 deletions
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;