ovl: warn if trusted xattr creation fails
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 27 Jul 2022 14:31:30 +0000 (16:31 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 27 Jul 2022 14:31:30 +0000 (16:31 +0200)
commitb10b85fe5149ee8b39fbbf86095b303632dde2cd
tree93a706f578c52c73579fffe393a65249316fd345
parente0dccc3b76fb35bb257b4118367a883073d7390e
ovl: warn if trusted xattr creation fails

When mounting overlayfs in an unprivileged user namespace, trusted xattr
creation will fail.  This will lead to failures in some file operations,
e.g. in the following situation:

  mkdir lower upper work merged
  mkdir lower/directory
  mount -toverlay -olowerdir=lower,upperdir=upper,workdir=work none merged
  rmdir merged/directory
  mkdir merged/directory

The last mkdir will fail:

  mkdir: cannot create directory 'merged/directory': Input/output error

The cause for these failures is currently extremely non-obvious and hard to
debug.  Hence, warn the user and suggest using the userxattr mount option,
if it is not already supplied and xattr creation fails during the
self-check.

Reported-by: Alois Wohlschlager <alois1@gmx-topmail.de>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/super.c