From: wang di <di.w...@intel.com>

The variable next needs only to be set when done is false.

Signed-off-by: wang di <di.w...@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906
Reviewed-by: John L. Hammond <john.hamm...@intel.com>
Reviewed-by: Andreas Dilger <andreas.dil...@intel.com>
Reviewed-by: Oleg Drokin <oleg.dro...@intel.com>
Signed-off-by: James Simmons <jsimm...@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index 77fadf1..48eacee 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) {
                                /*
-- 
1.7.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to