Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
3
-
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).
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47734/
Subject:
LU-15647utils: 'lfs df' shouldn't loop foreverProject: fs/lustre-release
Branch: b2_15
Current Patch Set:
Commit: ca05e79686313c9d92dfeb235591a13eed7c1c90