[LU-16480] Lustre fiemap does not properly handle fm_extent_count=0 Created: 16/Jan/23  Updated: 12/Sep/23  Resolved: 27/Jan/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Major
Reporter: Andrew Perepechko Assignee: Andrew Perepechko
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Related
is related to LU-17110 Slab corruption using fiemap ioctl wi... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

"fm_extent_count specifies the number of elements in the fm_extents[] array that can be used to return extents. If fm_extent_count is zero, then the fm_extents[] array is ignored (no extents will be returned), and the fm_mapped_extents count will hold the number of extents needed in fm_extents[] to hold the file’s current mapping."

 

https://www.kernel.org/doc/html/latest/filesystems/fiemap.html

 

In practice, depending on the state of the kernel thread stack, EINVAL can be returned to userspace even for simple single stripe files.

 

Details will follow.



 Comments   
Comment by Gerrit Updater [ 16/Jan/23 ]

"Andrew Perepechko <andrew.perepechko@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49645
Subject: LU-16480 lov: fiemap improperly handles fm_extent_count=0
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b787e4d0cf40569121980d2a984e0ae7f1b255b0

Comment by Gerrit Updater [ 27/Jan/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49645/
Subject: LU-16480 lov: fiemap improperly handles fm_extent_count=0
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 829af7b029d8e4e391b93792bf5214611b0193bd

Comment by Peter Jones [ 27/Jan/23 ]

Landed for 2.16

Comment by Gerrit Updater [ 07/Sep/23 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52308
Subject: LU-16480 lov: fiemap improperly handles fm_extent_count=0
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: 761fe3e18a625d0abf6168a1f6f3d3ce6a10af2b

Generated at Sat Feb 10 03:27:23 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.