Re: [PATCH] vfs: allow FILE_EXTENT_SAME (dedupe_file_range) on a file opened ro

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

 



On Mon, Jul 18, 2016 at 07:41:30PM -0700, Darrick J. Wong wrote:
> 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 <kilobyte@xxxxxxxxxx>
> 
> Could you please send an xfstest to test this aspect of the dedupe ioctl?

(Sorry for a late answer, at the time I kept thinking about possible other
tests.)

It looks like I don't see an appropriate test here.  The reason is, while
the intermittent failures can be reliably reproduced, they're not caused by
this ioctl but its prerequisite -- ie, needing the file open rw, and that
causing EXTXBSY on exec is expected and correct.

So what else could be tested?  Not general operation of FIDEDUPERANGE -- it
already has adequate tests.

As for this very change, ie, being able to dedupe with O_RDONLY:
1. it's in vfs rather than individual fs drivers, thus is unlikely to
   regress or fail to account for bugs in a new driver
2. the code to open the file lives in xfs_io in xfsprogs rather than
   fstests, thus changing it would need careful coordination between
   the two
On the other hand, once this commit gets merged, it'd be trivial to change
xfsprogs to do:
   open(..., (kernel version >= 4.9)?O_RDONLY:O_RDWR);
which would make all existing tests also guard against regressions in the
positive permissions case.


Meow!
-- 
A MAP07 (Dead Simple) raspberry tincture recipe: 0.5l 95% alcohol, 1kg
raspberries, 0.4kg sugar; put into a big jar for 1 month.  Filter out and
throw away the fruits (can dump them into a cake, etc), let the drink age
at least 3-6 months.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux