History

exportfs: allow exporting non-decodeable file handles to userspace

Some userspace programs use st_ino as a unique object identifier, even though inode numbers may be recycable. This issue has been addressed for NFS export long ago using the exportfs file handle API and the unique file handle identifiers are also exported to userspace via name_to_handle_at(2). fanotify also uses file handles to identify objects in events, but only for filesystems that support NFS export. Relax the requirement for NFS export support and allow more filesystems to export a unique object identifier via name_to_handle_at(2) with the flag AT_HANDLE_FID. A file handle requested with the AT_HANDLE_FID flag, may or may not be usable as an argument to open_by_handle_at(2). To allow filesystems to opt-in to supporting AT_HANDLE_FID, a struct export_operations is required, but even an empty struct is sufficient for encoding FIDs.

Amir Goldstein committed 3 years ago

Commit 96b2b071 parent 304e9c82 files · +19 −8Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/fcntl.h+5−0
@@ -112,4 +112,9 @@ · 111 unmodified lines
112 112
113#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */113#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
114 114
115/* Flags for name_to_handle_at(2). We reuse AT_ flag space to save bits... */
116#define AT_HANDLE_FID AT_REMOVEDIR /* file handle is needed to
117 compare object identity and may not
118 be usable to open_by_handle_at(2) */
119
115#endif /* _UAPI_LINUX_FCNTL_H */120#endif /* _UAPI_LINUX_FCNTL_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t