From: wang di Date: Fri, 22 Jul 2016 02:44:04 +0000 (-0400) Subject: staging: lustre: llite: set next only when needed in ll_dir_read X-Git-Tag: v4.9-rc1~119^2~1211 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fb659ca1a6ef6a952da1af50a63210e8cfb6daca;p=karo-tx-linux.git staging: lustre: llite: set next only when needed in ll_dir_read The variable next needs only to be set when done is false. Signed-off-by: wang di Reviewed-on: http://review.whamcloud.com/10761 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906 Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 77fadf1d2770..48eacee82a64 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -561,8 +561,9 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data, done = !dir_emit(ctx, ent->lde_name, namelen, ino, type); } - next = le64_to_cpu(dp->ldp_hash_end); + if (!done) { + next = le64_to_cpu(dp->ldp_hash_end); pos = next; if (pos == MDS_DIR_END_OFF) { /*