[LU-15647] "lfs df" should not loop indefinitely for new MDTs/OSTs Created: 13/Mar/22 Updated: 05/Jul/22 Resolved: 11/Jun/22 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.16.0, Lustre 2.15.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Andreas Dilger | Assignee: | Andreas Dilger |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Severity: | 3 | ||||
| Rank (Obsolete): | 9223372036854775807 | ||||
| Description |
|
The inner loop in lfs_df->mntdf() iterating over MDTs and OSTs will run forever if ENODEV is not returned, even if other errors are returned:
for (tp = types; tp->st_name != NULL; tp++) {
bool have_ost = false;
if (!(tp->st_op & ops))
continue;
for (index = 0; ; index++) {
rc2 = llapi_obd_fstatfs(fd, type, index, &stat_buf, &uuid_buf);
if (rc2 == -ENODEV)
break;
if (rc2 == -EAGAIN)
continue;
if (rc2 == -ENODATA) { /* Inactive device, OK. */
if (!(flags & MNTDF_VERBOSE))
continue;
} else if (rc2 < 0 && rc == 0) {
rc = rc2;
}
:
}
}
The inner loop should be limited to a maximum index of LOV_ALL_STRIPES (to avoid looping forever) and a maximum of LL_STATFS_MAX actual targets (to avoid overflowing the lsb->sb_buf[] array). |
| Comments |
| Comment by Gerrit Updater [ 13/Mar/22 ] |
|
"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46813 |
| Comment by Gerrit Updater [ 11/Jun/22 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46813/ |
| Comment by Peter Jones [ 11/Jun/22 ] |
|
Landed for 2.16 |
| Comment by Gerrit Updater [ 24/Jun/22 ] |
|
"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47734 |
| Comment by Gerrit Updater [ 05/Jul/22 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47734/ |