-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
FLR files read by fd on 2 clients
-
3
-
9223372036854775807
After another client changes a file's layout (a write that makes a mirror stale, a resync), fgetxattr(fd, "lustre.lov") on a file kept open returns the old layout until something else refreshes it, for example a stat(). llapi_layout_get_by_fd() reads the same xattr, so tools that read the layout of an open file act on a mirror state that is no longer true. getxattr by path mostly sees the change, since the lookup revalidates the inode.
Reproducer
Two clients A and B, a file with two mirrors in sync:
- A opens the file and reads the layout generation with fgetxattr(): 5
- B writes 4 KiB into the file: generation 6, one mirror stale
- A's fgetxattr() keeps returning 5 for at least 6 s, and 6 right after a stat()
Cause
ll_getxattr_lov() packs the layout of the client's cl_object with cl_object_layout_get() and never calls ll_layout_refresh().
Fix
Refresh the layout in getxattr of a regular file before packing it, as I/O does. With a cached layout lock this costs no RPC. Group-locked files are excluded, since a new layout would wait for the group lock’s own I/O (LU-17620). Details and tests are in the patch.