archive mirror
 help / color / mirror / Atom feed
From: Kevin Locke <>
To: Amir Goldstein <>
Cc:, Miklos Szeredi <>
Subject: [Regression] ovl: rename(2) EINVAL if lower doesn't support fileattrs
Date: Sun, 17 Oct 2021 14:46:02 -0600	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi all,

With 5.15-rc5 or torvalds master (d999ade1cc86), attempting to rename
a file fails with -EINVAL on an overlayfs mount with a lower
filesystem that returns -EINVAL for ioctl(FS_IOC_GETFLAGS).  For
example, with ntfs-3g:

    mkdir lower upper work overlay
    dd if=/dev/zero of=ntfs.raw bs=1M count=2
    mkntfs -F ntfs.raw
    mount ntfs.raw lower
    touch lower/file.txt
    mount -t overlay -o "lowerdir=$PWD/lower,upperdir=$PWD/upper,workdir=$PWD/work" - overlay
    mv overlay/file.txt overlay/file2.txt

mv fails and (misleadingly) prints

    mv: cannot move 'overlay/file.txt' to a subdirectory of itself, 'overlay/file2.txt'

which strace(1) reveals to be due to rename(2) returning -22
(-EINVAL).  A bit of digging revealed that -EINVAL is coming from
vfs_fileattr_get() with the following stack:

ovl_real_fileattr_get.cold+0x9/0x12 [overlay]
ovl_copy_up_inode+0x1b5/0x280 [overlay]
ovl_copy_up_one+0xaf1/0xee0 [overlay]
ovl_copy_up_flags+0xab/0xf0 [overlay]
ovl_rename+0x149/0x850 [overlay]
? privileged_wrt_inode_uidgid+0x47/0x60
? generic_permission+0x90/0x200
? ovl_permission+0x70/0x120 [overlay]

This issue does not occur on 5.14.  I've bisected the regression to


  reply	other threads:[~2021-10-17 20:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2021-09-10  0:17 ` [PATCH AUTOSEL 5.13 40/88] ovl: copy up sync/noatime fileattr flags Sasha Levin
2021-10-17 20:46   ` Kevin Locke [this message]
2021-10-18  8:47     ` [Regression] ovl: rename(2) EINVAL if lower doesn't support fileattrs Miklos Szeredi
2021-10-18 14:02       ` Kevin Locke
2021-09-10  0:17 ` [PATCH AUTOSEL 5.13 41/88] ovl: skip checking lower file's i_writecount on truncate Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).