Skip to content

RFC fscrypt error code cleanup

Eric Biggers linux-ext4 linux-f2fs-devel linux-fsdevel 1 version Applied

Status from this message: Applied to the fscrypt branch, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 5 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5fscrypt: use ENOKEY when file cannot be created w/o keyfs/crypto/fname.c fs/ext4/ialloc.c fs/ext4/namei.c +2 more+12 -71 reply
2/5fscrypt: use ENOTDIR when setting encryption policy on nondirectoryfs/crypto/policy.c+1 -11 reply
3/5fscrypt: use EEXIST when file already uses different policyfs/crypto/policy.c+1 -11 reply
4/5fscrypt: remove user-triggerable warning messagesfs/crypto/policy.c+2 -131 reply
5/5fscrypt: pass up error codes from ->get_context()fs/crypto/policy.c+23 -311 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] fscrypt error code cleanup

As suggested by Richard Weinberger, we need to agree on and document a clear set of fscrypt-related error codes.

I identified several cases where the error codes are not consistent between or within filesystems, or are ambiguous with other errors. This patchset proposes several changes to resolve these problems.

I believe we do still have some flexibility to make changes to these error codes since there are not many different users of filesystem-level encryption yet, and depending on these specific errors would be unusual. There have also already been cases where some of these error codes have changed before.

Currently this patchset depends on the following patch being applied first:
"fscrypto: move ioctl processing more fully into common code"

Eric Biggers (5):
fscrypt: use ENOKEY when file cannot be created w/o key
fscrypt: use ENOTDIR when setting encryption policy on nondirectory
fscrypt: use EEXIST when file already uses different policy
fscrypt: remove user-triggerable warning messages
fscrypt: pass up error codes from ->get_context()

 fs/crypto/fname.c  |  4 +--
 fs/crypto/policy.c | 73 ++++++++++++++++++++----------------------------------
 fs/ext4/ialloc.c   |  2 +-
 fs/ext4/namei.c    |  4 ++-
 fs/f2fs/dir.c      |  5 +++-
 fs/f2fs/namei.c    |  4 +--
 6 files changed, 39 insertions(+), 53 deletions(-)
Signature · 1 line
2.8.0.rc3.226.g39d4020