[Regression] ovl: rename(2) EINVAL if lower doesn't support fileattrs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]
vfs_rename+0x619/0x9d0
do_renameat2+0x3c0/0x570
__x64_sys_renameat2+0x4b/0x60
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae

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

Thanks,
Kevin



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux