Skip to content

Instantly share code, notes, and snippets.

@ruiwen-zhao
Created September 1, 2023 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruiwen-zhao/93ebe0b4ad20fab005d0300e9f0194c2 to your computer and use it in GitHub Desktop.
Save ruiwen-zhao/93ebe0b4ad20fab005d0300e9f0194c2 to your computer and use it in GitHub Desktop.
ignore ENXIO in ovl_copy_fileattr
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index ef0bf98b6..77a94db11 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -142,7 +142,7 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old,
err = ovl_real_fileattr_get(old, &oldfa);
if (err) {
/* Ntfs-3g returns -EINVAL for "no fileattr support" */
- if (err == -ENOTTY || err == -EINVAL)
+ if (err == -ENOTTY || err == -EINVAL || err == -ENXIO)
return 0;
pr_warn("failed to retrieve lower fileattr (%pd2, err=%i)\n",
old->dentry, err);
@@ -173,7 +173,7 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old,
* Returning an error if upper doesn't support fileattr will
* result in a regression, so revert to the old behavior.
*/
- if (err == -ENOTTY || err == -EINVAL) {
+ if (err == -ENOTTY || err == -EINVAL || err == -ENXIO) {
pr_warn_once("copying fileattr: no support on upper\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment