diff options
author | Giuseppe Di Natale <dinatale2@llnl.gov> | 2017-01-29 03:04:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-03 15:01:37 +0300 |
commit | 65aaf99d5dc12a7807da3008e0cd9babc1cad265 (patch) | |
tree | 987dce4904e2518ab82da74f2f90ee19053d9b59 | |
parent | 8a140b45e4ad63377f9a1753a38613252ee6092a (diff) | |
download | linux-65aaf99d5dc12a7807da3008e0cd9babc1cad265.tar.xz |
staging: lustre: lmv: Correctly generate target_obd
The target_obd debugfs file was not being generated correctly
in cases where nonconsecutive MDT indices were used when
generating a filesystem.
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8100
Reviewed-on: http://review.whamcloud.com/20336
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c index 20bbdfc21d15..14fbc9cda087 100644 --- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c +++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c @@ -147,7 +147,13 @@ static void *lmv_tgt_seq_start(struct seq_file *p, loff_t *pos) struct obd_device *dev = p->private; struct lmv_obd *lmv = &dev->u.lmv; - return (*pos >= lmv->desc.ld_tgt_count) ? NULL : lmv->tgts[*pos]; + while (*pos < lmv->tgts_size) { + if (lmv->tgts[*pos]) + return lmv->tgts[*pos]; + ++*pos; + } + + return NULL; } static void lmv_tgt_seq_stop(struct seq_file *p, void *v) @@ -159,8 +165,15 @@ static void *lmv_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos) { struct obd_device *dev = p->private; struct lmv_obd *lmv = &dev->u.lmv; + ++*pos; - return (*pos >= lmv->desc.ld_tgt_count) ? NULL : lmv->tgts[*pos]; + while (*pos < lmv->tgts_size) { + if (lmv->tgts[*pos]) + return lmv->tgts[*pos]; + ++*pos; + } + + return NULL; } static int lmv_tgt_seq_show(struct seq_file *p, void *v) |