[lustre-devel] Reserve OBD_CONNECT2 flag for truncate(0) degraded layout replace

Keguang Xu kxu at ddn.com
Thu Jul 16 03:32:52 UTC 2026


Hi Andreas,

I'd like to reserve a new OBD_CONNECT2 bit for an upcoming feature (currently drafted as OBD_CONNECT2_LAYOUT_REPLACED, maybe 0x400000000000ULL ?).

Feature
Please check https://jira.whamcloud.com/browse/LU-20211, on truncate(0), if the current file layout has unavailable/degraded stripes (e.g. OST marked degraded), the MDS may replace the layout (orphan + swap_layouts) so the client can continue with a usable layout. After a successful replace, the setattr reply returns the new LOVEA.
The client must discard the old page/OSC cache during layout apply, instead of doing CL_FSYNC_LOCAL writeback to the old (possibly degraded) stripes. Otherwise layout change fails with -EINVAL, while the MDS has already committed truncate + layout replace.

Why a new connect flag is needed
This behavior requires coordinated client/MDS support:

  *   New MDS + old client: if the MDS replaces the layout anyway, the old client still writebacks on layout change and can fail truncate with -EINVAL, leaving server/client state inconsistent.
  *
With a connect flag, the MDS can skip layout replace unless the client advertised support, and the client knows to discard-prune.

Thanks,
Keguang Xu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-devel_lists.lustre.org/attachments/20260716/c435be80/attachment.html>


More information about the lustre-devel mailing list