[LU-946] add lprocfs file on MDT to list open files in the filesystem Created: 20/Dec/11 Updated: 21/Feb/14 Resolved: 13/Jan/14 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.6.0, Lustre 2.5.1 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Andreas Dilger | Assignee: | Emoly Liu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Issue Links: |
|
||||||||||||
| Story Points: | 5 | ||||||||||||
| Rank (Obsolete): | 7881 | ||||||||||||
| Description |
|
Several customers have asked for the ability to list open files on the whole filesystem. Currently this is only possible to do on the clients by running "lsof" but is impractical to do. This would likely be implemented by walking all of the client exports and then listing all of the objects in med_open_head as NID_FID pairs. Userspace could then sort/print the open files as desired using "lfs fid2path". |
| Comments |
| Comment by Andreas Dilger [ 25/Apr/13 ] |
|
This would ideally be available on the MDS per-export in /proc/fs/lustre/mdt/$fsname-MDTnnnn/exports/$NID/open_files with just a FID list. Userspace could just do lctl get_param mdt.$fsname-MDTnnnn.exports.$NID.open_files and pipe that to lfs fid2path (with my patch in http://review.whamcloud.com/6160 in |
| Comment by Girish Shilamkar (Inactive) [ 03/May/13 ] |
|
Hello, I have started working on this ticket but don't have permissions to assign it to myself. Regards, |
| Comment by Emoly Liu [ 07/May/13 ] |
|
Girish, it says the user doesn't exist. Anyway, you can push your patch to gerrit and paste the link here. If you don't mind, I'd like to assign to me and take care of the patch. |
| Comment by Girish Shilamkar (Inactive) [ 15/May/13 ] |
|
Andreas, med_open_head is list of mdt_file_data objects. And struct mdt_file_data is an internal structure to mdt. So we cannot walk med_open_head from obdclass(lprocfs_status.c) using this linked list. We could have had a function in mdt to return lu_object for a given mdt_file_data object but that would make odbclass module dependent on mdt. (mdt is already used by obdclass) Other than this layering issue the patch is ready with a testcase. |
| Comment by Andreas Dilger [ 15/May/13 ] |
|
Girish, |
| Comment by Girish Shilamkar (Inactive) [ 19/May/13 ] |
| Comment by Emoly Liu [ 13/Jan/14 ] |
|
Patch landed for 2.6 |