Don't loop forever in "lfs df" if there is a problem fetching
the target statfs information from the kernel and -ENODEV is
not returned for whatever reason.
Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I5110c7246cf53eb5c4d59424a44b73b9d23ebbe5
Reviewed-on: https://review.whamcloud.com/46813
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (!(tp->st_op & ops))
continue;
- for (index = 0; ; index++) {
+ for (index = 0; index < LOV_ALL_STRIPES &&
+ (!lsb || lsb->sb_count < LL_STATFS_MAX); index++) {
memset(&stat_buf, 0, sizeof(struct obd_statfs));
memset(&uuid_buf, 0, sizeof(struct obd_uuid));
type = flags & MNTDF_LAZY ?
tp->st_op | LL_STATFS_NODELAY : tp->st_op;
rc2 = llapi_obd_fstatfs(fd, type, index,
- &stat_buf, &uuid_buf);
+ &stat_buf, &uuid_buf);
if (rc2 == -ENODEV)
break;
if (rc2 == -EAGAIN)