From: Adam Borowski <hidden> Date: 2016-07-17 22:13:38
Instead of checking the mode of the file descriptor, let's check whether it
could have been opened rw. This allows fixing intermittent exec failures
when deduping a live system: anyone trying to exec a file currently being
deduped gets ETXTBSY.
Issuing this ioctl on a ro file was already allowed for root/cap.
Tested on btrfs and not-yet-merged xfs, as only them implement this ioctl.
Signed-off-by: Adam Borowski <redacted>
---
fs/read_write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Adam Borowski <hidden> Date: 2016-07-17 22:32:33
On Mon, Jul 18, 2016 at 12:13:38AM +0200, Adam Borowski wrote:
Instead of checking the mode of the file descriptor, let's check whether it
could have been opened rw. This allows fixing intermittent exec failures
when deduping a live system: anyone trying to exec a file currently being
deduped gets ETXTBSY.
Issuing this ioctl on a ro file was already allowed for root/cap.
Tested on btrfs and not-yet-merged xfs, as only them implement this ioctl.
This is a resend of a patch I've targetted at the wrong maintainer (btrfs
guys rather than Al Viro/vfs). Since then, I've tested it on xfs-devel
(f0b34b677df10d9e3deffcd0b1c1aaaaf0234b80 atop of 4.7-rc5 and -rc7).
Review so far:
http://thread.gmane.org/gmane.comp.file-systems.btrfs/56563
An idea to relax the check and allow dedupe to everyone who can read the
file was shot down because of concerns that in some edge cases it might be
possible to clobber a targetted file. Thus, we're back to the original
patch, requiring ro descriptor but rw permission.
Meow!
--
An imaginary friend squared is a real enemy.
From: Mark Fasheh <hidden> Date: 2016-07-18 19:51:51
On Mon, Jul 18, 2016 at 12:13:38AM +0200, Adam Borowski wrote:
Instead of checking the mode of the file descriptor, let's check whether it
could have been opened rw. This allows fixing intermittent exec failures
when deduping a live system: anyone trying to exec a file currently being
deduped gets ETXTBSY.
Issuing this ioctl on a ro file was already allowed for root/cap.
Tested on btrfs and not-yet-merged xfs, as only them implement this ioctl.
Signed-off-by: Adam Borowski <redacted>
Reviewed-by: Mark Fasheh <redacted>
--Mark
--
Mark Fasheh
From: Darrick J. Wong <hidden> Date: 2016-07-19 02:41:50
On Mon, Jul 18, 2016 at 12:13:38AM +0200, Adam Borowski wrote:
Instead of checking the mode of the file descriptor, let's check whether it
could have been opened rw. This allows fixing intermittent exec failures
when deduping a live system: anyone trying to exec a file currently being
deduped gets ETXTBSY.
Issuing this ioctl on a ro file was already allowed for root/cap.
Tested on btrfs and not-yet-merged xfs, as only them implement this ioctl.
Signed-off-by: Adam Borowski <redacted>
Could you please send an xfstest to test this aspect of the dedupe ioctl?
--D