Skip to contentSkip to conversation

docs: fscrypt: document EFAULT return for FS_IOC_SET_ENCRYPTION_POLICY

PATCH In review Divya Bharathi 2 participants 2 messages Oct 10, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: fscrypt: document EFAULT return for FS_IOC_SET_ENCRYPTION_POLICY

---
 Documentation/filesystems/fscrypt.rst | 2 ++
 1 file changed, 2 insertions(+)
Documentation/filesystems/fscrypt.rst +2 -0
index 4a3e844b7..26cb409e3 100644
@@ -729,6 +729,8 @@ FS_IOC_SET_ENCRYPTION_POLICY can fail with the following errors:
   version, mode(s), or flags; or reserved bits were set); or a v1
   encryption policy was specified but the directory has the casefold
   flag enabled (casefolding is incompatible with v1 policies).
+- ``EFAULT``: an invalid pointer was passed for the encryption policy
+  structure
 - ``ENOKEY``: a v2 encryption policy was specified, but the key with
   the specified ``master_key_identifier`` has not been added, nor does
   the process have the CAP_FOWNER capability in the initial user
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 21 lines · Divya Bharathi
---
 Documentation/filesystems/fscrypt.rst | 2 ++
 1 file changed, 2 insertions(+)
Documentation/filesystems/fscrypt.rst +2 -0
index 4a3e844b7..26cb409e3 100644
@@ -729,6 +729,8 @@ FS_IOC_SET_ENCRYPTION_POLICY can fail with the following errors:
   version, mode(s), or flags; or reserved bits were set); or a v1
   encryption policy was specified but the directory has the casefold
   flag enabled (casefolding is incompatible with v1 policies).
+- ``EFAULT``: an invalid pointer was passed for the encryption policy
+  structure
 - ``ENOKEY``: a v2 encryption policy was specified, but the key with
   the specified ``master_key_identifier`` has not been added, nor does
   the process have the CAP_FOWNER capability in the initial user
Signature · 1 line
2.51.0

Thanks for the patch!

I think I omitted EFAULT intentionally, since it's always a possibility for almost any ioctl or syscall that takes a pointer parameter.

If we'd like to explicitly document it, it probably should be documented for all the ioctls in fscrypt.rst, rather than just FS_IOC_SET_ENCRYPTION_POLICY.

Also, the list of error codes is alphabetized. EFAULT should go into the correct position in the list.

- Eric