All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 197045] New: renameat2 rename_noreplace
@ 2017-09-26 16:27 bugzilla-daemon
  2017-09-26 16:42 ` [Bug 197045] " bugzilla-daemon
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-09-26 16:27 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

            Bug ID: 197045
           Summary: renameat2 rename_noreplace
           Product: File System
           Version: 2.5
    Kernel Version: 4.4.0, 4.11.0
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: ext4
          Assignee: fs_ext4@kernel-bugs.osdl.org
          Reporter: martin@salbaba.co.at
        Regression: No

on ext4 renameat2 fails in conjunction with RENAME_NOREPLACE, if the target
file is not present

renameat2(AT_FDCWD, "rename-test-a", AT_FDCWD, "rename-test-c",
RENAME_NOREPLACE) = -1 EINVAL (Invalid argument)

if the target file is present, functionality is ok

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
@ 2017-09-26 16:42 ` bugzilla-daemon
  2017-10-24 12:28 ` bugzilla-daemon
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-09-26 16:42 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #1 from Martin Salbba (martin@salbaba.co.at) ---
works with brtfs and xfs

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
  2017-09-26 16:42 ` [Bug 197045] " bugzilla-daemon
@ 2017-10-24 12:28 ` bugzilla-daemon
  2017-10-24 12:29 ` bugzilla-daemon
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 12:28 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

Elvis Stansvik (elvstone@gmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |elvstone@gmail.com

--- Comment #2 from Elvis Stansvik (elvstone@gmail.com) ---
Created attachment 260359
  --> https://bugzilla.kernel.org/attachment.cgi?id=260359&action=edit
Test case showing the problem

A test case, run with a.out <srcfile> <dstfile>

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
  2017-09-26 16:42 ` [Bug 197045] " bugzilla-daemon
  2017-10-24 12:28 ` bugzilla-daemon
@ 2017-10-24 12:29 ` bugzilla-daemon
  2017-10-24 17:41 ` bugzilla-daemon
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 12:29 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #3 from Elvis Stansvik (elvstone@gmail.com) ---
I'm hit by this on 4.10 a well (the default kernel on Ubuntu 16.04).

I attached a full test case showing.

Example run:


> [estan@newton renameat2tc]$ gcc renameat2.c 
> [estan@newton renameat2tc]$ touch foo
> [estan@newton renameat2tc]$ ./a.out foo bar
> Invalid argument
> [estan@newton renameat2tc]$ uname -a
> Linux newton 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC
> 2017 x86_64 x86_64 x86_64 GNU/Linux
> [estan@newton renameat2tc]$ mount | grep " / "
> /dev/sda1 on / type ext4 (rw,noatime,discard,errors=remount-ro,data=ordered)

The reason I discovered it was that Qt recently started using this syscall,
which in turn made Qt Creator (a Qt application) fail to write its config
files.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (2 preceding siblings ...)
  2017-10-24 12:29 ` bugzilla-daemon
@ 2017-10-24 17:41 ` bugzilla-daemon
  2017-10-24 19:22 ` bugzilla-daemon
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 17:41 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

Thiago Macieira (thiago@macieira.org) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thiago@macieira.org

--- Comment #4 from Thiago Macieira (thiago@macieira.org) ---
Martin: can you confirm you did see these issues on 4.4 and 4.11? Elvis is
reporting he did not see the issue on 4.4.

By any chance, are you also on Ubuntu?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (3 preceding siblings ...)
  2017-10-24 17:41 ` bugzilla-daemon
@ 2017-10-24 19:22 ` bugzilla-daemon
  2017-10-24 19:31 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 19:22 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #5 from Elvis Stansvik (elvstone@gmail.com) ---
Martin: I've just discovered that I only see this problem when on my eCryptfs
encrypted home directory, not when testing in e.g. /tmp (unencrypted). Are you
also using eCryptfs?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (4 preceding siblings ...)
  2017-10-24 19:22 ` bugzilla-daemon
@ 2017-10-24 19:31 ` bugzilla-daemon
  2017-10-24 19:35 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 19:31 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #6 from Elvis Stansvik (elvstone@gmail.com) ---
So I guess I'm hitting this:
https://github.com/torvalds/linux/blob/master/fs/ecryptfs/inode.c#L592

Seems rename flags are not supported on ecryptfs, plain and simple?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (5 preceding siblings ...)
  2017-10-24 19:31 ` bugzilla-daemon
@ 2017-10-24 19:35 ` bugzilla-daemon
  2017-10-24 19:41 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 19:35 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #7 from Elvis Stansvik (elvstone@gmail.com) ---
Here's the patch that added the if (flags) return EINVAL; for ecryptfs:

https://patchwork.kernel.org/patch/9295699/

So I guess it's just expected that it won't work on ecryptfs.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (6 preceding siblings ...)
  2017-10-24 19:35 ` bugzilla-daemon
@ 2017-10-24 19:41 ` bugzilla-daemon
  2017-10-24 20:25 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 19:41 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #8 from Elvis Stansvik (elvstone@gmail.com) ---
Though I wonder if that is correct, or if it was hastily added by mistake for
ecryptfs as part of that mass porting to rename2.. Maybe it would just work if
ecryptfs_rename simply forwarded the flags to vfs_rename without checking
them..? Someone who knows the code will have to answer.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (7 preceding siblings ...)
  2017-10-24 19:41 ` bugzilla-daemon
@ 2017-10-24 20:25 ` bugzilla-daemon
  2017-10-24 21:03 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 20:25 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #9 from Elvis Stansvik (elvstone@gmail.com) ---
Scratch that, it's obviously not that easy.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (8 preceding siblings ...)
  2017-10-24 20:25 ` bugzilla-daemon
@ 2017-10-24 21:03 ` bugzilla-daemon
  2017-10-24 21:14 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 21:03 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #10 from Thiago Macieira (thiago@macieira.org) ---
No, it seems that non-local filesystems need specific code to guarante
RENAME_NOREPLACE, so the EINVAL error is legitimate.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (9 preceding siblings ...)
  2017-10-24 21:03 ` bugzilla-daemon
@ 2017-10-24 21:14 ` bugzilla-daemon
  2017-10-24 21:35 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 21:14 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

Theodore Tso (tytso@mit.edu) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tytso@mit.edu
         Resolution|---                         |INVALID

--- Comment #11 from Theodore Tso (tytso@mit.edu) ---
I've confirmed that the test case works just fine on plain ext4, using the 4.13
based kernel.  I've also confirmed that it works just fine if you use ext4
encryption.  (I suggest that Ubuntu users file a feature request bug to Ubuntu
to ditch ecryptfs and switch to ext4 encryption.)

I can also confirm that ecryptfs != ext4, and that discussing this here has
approximately zero chance of it being noticed by the ecryptfs maintainer.  
Since Tyler works at Canonical, filing a Launchpad bug is most likely to get
someone to look at it.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (10 preceding siblings ...)
  2017-10-24 21:14 ` bugzilla-daemon
@ 2017-10-24 21:35 ` bugzilla-daemon
  2017-10-24 21:42 ` bugzilla-daemon
  2017-10-25  8:59 ` bugzilla-daemon
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 21:35 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #12 from Thiago Macieira (thiago@macieira.org) ---
Thanks Ted.

For the record, I'm applying a fix to the Qt code, since the error is
legitimate for non-local fs: https://codereview.qt-project.org/209385

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (11 preceding siblings ...)
  2017-10-24 21:35 ` bugzilla-daemon
@ 2017-10-24 21:42 ` bugzilla-daemon
  2017-10-25  8:59 ` bugzilla-daemon
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-24 21:42 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #13 from Elvis Stansvik (elvstone@gmail.com) ---
Indeed, I'll file an LP bug and try to ping Tyler. Who knows, perhaps they're
already planning to switch to encrypted ext4 (thanks for testing that Ted).

And thanks to Thiago for being so quick with the Qt fix (I ran into this
behavior by way of Qt).

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug 197045] renameat2 rename_noreplace
  2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
                   ` (12 preceding siblings ...)
  2017-10-24 21:42 ` bugzilla-daemon
@ 2017-10-25  8:59 ` bugzilla-daemon
  13 siblings, 0 replies; 15+ messages in thread
From: bugzilla-daemon @ 2017-10-25  8:59 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=197045

--- Comment #14 from Theodore Tso (tytso@mit.edu) ---
Michael Halcrow (the original author of ecryptfs, and who has jokingly referred
to his work on ext4 encryption as his apology for ecryptfs :-) and I have
talked to Tyler about Ubuntu switching to ext4 encryption.   This is really
going to be a matter of prioritizing work at Canonical; so user feature
requests (especially requests from paying users :-) would be helpful.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-10-25  8:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 16:27 [Bug 197045] New: renameat2 rename_noreplace bugzilla-daemon
2017-09-26 16:42 ` [Bug 197045] " bugzilla-daemon
2017-10-24 12:28 ` bugzilla-daemon
2017-10-24 12:29 ` bugzilla-daemon
2017-10-24 17:41 ` bugzilla-daemon
2017-10-24 19:22 ` bugzilla-daemon
2017-10-24 19:31 ` bugzilla-daemon
2017-10-24 19:35 ` bugzilla-daemon
2017-10-24 19:41 ` bugzilla-daemon
2017-10-24 20:25 ` bugzilla-daemon
2017-10-24 21:03 ` bugzilla-daemon
2017-10-24 21:14 ` bugzilla-daemon
2017-10-24 21:35 ` bugzilla-daemon
2017-10-24 21:42 ` bugzilla-daemon
2017-10-25  8:59 ` bugzilla-daemon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.