* Copy on write hard links? @ 2013-09-24 18:36 Thomas Meyer 2013-09-25 1:40 ` Adam Borowski 2013-09-25 13:59 ` Rob Landley 0 siblings, 2 replies; 9+ messages in thread From: Thomas Meyer @ 2013-09-24 18:36 UTC (permalink / raw) To: linux-kernel@vger.kernel.org Hi, Is there such a thing? With kind regards Thomas ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-24 18:36 Copy on write hard links? Thomas Meyer @ 2013-09-25 1:40 ` Adam Borowski 2013-09-25 13:59 ` Rob Landley 1 sibling, 0 replies; 9+ messages in thread From: Adam Borowski @ 2013-09-25 1:40 UTC (permalink / raw) To: Thomas Meyer; +Cc: linux-kernel@vger.kernel.org On Tue, Sep 24, 2013 at 08:36:56PM +0200, Thomas Meyer wrote: > Is there such a thing? In mainline, AFAIK no. The vserver patchset, on the other hand, adds a new xattr, iunlink, that copies the whole file when needed. That works on most filesystems. That's quite a hack, though, and I think you'd be better off using btrfs which does cow transparently at a lower level than hardlinks. -- ᛊᚨᚾᛁᛏᚣ᛫ᛁᛊ᛫ᚠᛟᚱ᛫ᚦᛖ᛫ᚹᛖᚨᚲ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-24 18:36 Copy on write hard links? Thomas Meyer 2013-09-25 1:40 ` Adam Borowski @ 2013-09-25 13:59 ` Rob Landley 2013-09-25 14:28 ` Thomas Meyer 1 sibling, 1 reply; 9+ messages in thread From: Rob Landley @ 2013-09-25 13:59 UTC (permalink / raw) To: Thomas Meyer; +Cc: linux-kernel@vger.kernel.org On 09/24/2013 01:36:56 PM, Thomas Meyer wrote: > Hi, > > Is there such a thing? In the kernel's vfs layer? No, although some filesystems (ala btrfs) do things like that with snapshots. In userspace? Breaking hardlinks when updating a file is fairly normal, that's why they distinguish between "truncate and rewrite" (preserve hardlinks) and "write new file and rename over old file" (break hardlinks, avoiding the more obvious race conditions). Rob ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-25 13:59 ` Rob Landley @ 2013-09-25 14:28 ` Thomas Meyer 2013-09-25 14:37 ` richard -rw- weinberger 2013-12-13 22:58 ` Jörn Engel 0 siblings, 2 replies; 9+ messages in thread From: Thomas Meyer @ 2013-09-25 14:28 UTC (permalink / raw) To: Rob Landley; +Cc: linux-kernel@vger.kernel.org Am Mittwoch, den 25.09.2013, 08:59 -0500 schrieb Rob Landley: > On 09/24/2013 01:36:56 PM, Thomas Meyer wrote: > > Hi, > > > > Is there such a thing? > > In the kernel's vfs layer? Yes, that would be a nice feature! > No, although some filesystems (ala btrfs) do > things like that with snapshots. > > In userspace? Breaking hardlinks when updating a file is fairly normal, > that's why they distinguish between "truncate and rewrite" (preserve > hardlinks) and "write new file and rename over old file" (break > hardlinks, avoiding the more obvious race conditions). so every user space application needs to implement that for itself? I wonder how hard it would be to implement this on vfs layer? linkat() with a new flag as api or something like that. > > Rob ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-25 14:28 ` Thomas Meyer @ 2013-09-25 14:37 ` richard -rw- weinberger 2013-09-29 5:22 ` Pádraig Brady 2013-12-13 22:58 ` Jörn Engel 1 sibling, 1 reply; 9+ messages in thread From: richard -rw- weinberger @ 2013-09-25 14:37 UTC (permalink / raw) To: Thomas Meyer; +Cc: Rob Landley, linux-kernel@vger.kernel.org On Wed, Sep 25, 2013 at 4:28 PM, Thomas Meyer <thomas@m3y3r.de> wrote: > Am Mittwoch, den 25.09.2013, 08:59 -0500 schrieb Rob Landley: >> On 09/24/2013 01:36:56 PM, Thomas Meyer wrote: >> > Hi, >> > >> > Is there such a thing? >> >> In the kernel's vfs layer? > > Yes, that would be a nice feature! You mean reflinks? Currently only OCFS2 and btrfs support them. Both using a fs specific ioctl(). IIRC GNU cp uses the btrfs specific one if the --reflink parameter is used. -- Thanks, //richard ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-25 14:37 ` richard -rw- weinberger @ 2013-09-29 5:22 ` Pádraig Brady 2013-09-29 7:14 ` Richard Weinberger 0 siblings, 1 reply; 9+ messages in thread From: Pádraig Brady @ 2013-09-29 5:22 UTC (permalink / raw) To: richard -rw- weinberger Cc: Thomas Meyer, Rob Landley, linux-kernel@vger.kernel.org On 09/25/2013 03:37 PM, richard -rw- weinberger wrote: > On Wed, Sep 25, 2013 at 4:28 PM, Thomas Meyer <thomas@m3y3r.de> wrote: >> Am Mittwoch, den 25.09.2013, 08:59 -0500 schrieb Rob Landley: >>> On 09/24/2013 01:36:56 PM, Thomas Meyer wrote: >>>> Hi, >>>> >>>> Is there such a thing? >>> >>> In the kernel's vfs layer? >> >> Yes, that would be a nice feature! > > You mean reflinks? > Currently only OCFS2 and btrfs support them. > Both using a fs specific ioctl(). > IIRC GNU cp uses the btrfs specific one if the --reflink parameter is used. coreutils is waiting for a reflink syscall to materialize rather than adding new per filesystem support http://lwn.net/Articles/335380/ thanks, Pádraig. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-29 5:22 ` Pádraig Brady @ 2013-09-29 7:14 ` Richard Weinberger 2013-09-29 17:19 ` Pádraig Brady 0 siblings, 1 reply; 9+ messages in thread From: Richard Weinberger @ 2013-09-29 7:14 UTC (permalink / raw) To: Pádraig Brady Cc: Thomas Meyer, Rob Landley, linux-kernel@vger.kernel.org On Sun, Sep 29, 2013 at 7:22 AM, Pádraig Brady <P@draigbrady.com> wrote: > On 09/25/2013 03:37 PM, richard -rw- weinberger wrote: >> On Wed, Sep 25, 2013 at 4:28 PM, Thomas Meyer <thomas@m3y3r.de> wrote: >>> Am Mittwoch, den 25.09.2013, 08:59 -0500 schrieb Rob Landley: >>>> On 09/24/2013 01:36:56 PM, Thomas Meyer wrote: >>>>> Hi, >>>>> >>>>> Is there such a thing? >>>> >>>> In the kernel's vfs layer? >>> >>> Yes, that would be a nice feature! >> >> You mean reflinks? >> Currently only OCFS2 and btrfs support them. >> Both using a fs specific ioctl(). >> IIRC GNU cp uses the btrfs specific one if the --reflink parameter is used. > > coreutils is waiting for a reflink syscall to materialize > rather than adding new per filesystem support > http://lwn.net/Articles/335380/ Is this the correct link? It's a proposal for a reflink() syscall. But corrently both OCFS2 and btrfs are using ioctl(). Digging into GNU coreutils shows that their cp's clone_file() only supports the btrfs ioctl(). I don't know what the GNU folks big plan is, maybe you know more. :-) -- Thanks, //richard ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-29 7:14 ` Richard Weinberger @ 2013-09-29 17:19 ` Pádraig Brady 0 siblings, 0 replies; 9+ messages in thread From: Pádraig Brady @ 2013-09-29 17:19 UTC (permalink / raw) To: Richard Weinberger Cc: Thomas Meyer, Rob Landley, linux-kernel@vger.kernel.org On 09/29/2013 08:14 AM, Richard Weinberger wrote: > On Sun, Sep 29, 2013 at 7:22 AM, Pádraig Brady <P@draigbrady.com> wrote: >> On 09/25/2013 03:37 PM, richard -rw- weinberger wrote: >>> On Wed, Sep 25, 2013 at 4:28 PM, Thomas Meyer <thomas@m3y3r.de> wrote: >>>> Am Mittwoch, den 25.09.2013, 08:59 -0500 schrieb Rob Landley: >>>>> On 09/24/2013 01:36:56 PM, Thomas Meyer wrote: >>>>>> Hi, >>>>>> >>>>>> Is there such a thing? >>>>> >>>>> In the kernel's vfs layer? >>>> >>>> Yes, that would be a nice feature! >>> >>> You mean reflinks? >>> Currently only OCFS2 and btrfs support them. >>> Both using a fs specific ioctl(). >>> IIRC GNU cp uses the btrfs specific one if the --reflink parameter is used. >> >> coreutils is waiting for a reflink syscall to materialize >> rather than adding new per filesystem support >> http://lwn.net/Articles/335380/ > > Is this the correct link? It's a proposal for a reflink() syscall. > But corrently both OCFS2 and btrfs are using ioctl(). > > Digging into GNU coreutils shows that their cp's > clone_file() only supports the btrfs ioctl(). > I don't know what the GNU folks big plan is, maybe you know more. :-) The current coreutils plan is to not to call any more file system specific ioctls, rather waiting until a more general syscall is available. thanks, Pádraig. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Copy on write hard links? 2013-09-25 14:28 ` Thomas Meyer 2013-09-25 14:37 ` richard -rw- weinberger @ 2013-12-13 22:58 ` Jörn Engel 1 sibling, 0 replies; 9+ messages in thread From: Jörn Engel @ 2013-12-13 22:58 UTC (permalink / raw) To: Thomas Meyer; +Cc: Rob Landley, linux-kernel@vger.kernel.org On Wed, 25 September 2013 16:28:53 +0200, Thomas Meyer wrote: > > I wonder how hard it would be to implement this on vfs layer? As an ugly hack: a few weeks maybe. Did it back in 2005 or so. If you have higher standards, you will need support from the underlying filesystem. Especially in order to make copying a large file on slow storage anything but a nightmare. Jörn -- When in doubt, use brute force. -- Ken Thompson ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-12-14 0:19 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-09-24 18:36 Copy on write hard links? Thomas Meyer 2013-09-25 1:40 ` Adam Borowski 2013-09-25 13:59 ` Rob Landley 2013-09-25 14:28 ` Thomas Meyer 2013-09-25 14:37 ` richard -rw- weinberger 2013-09-29 5:22 ` Pádraig Brady 2013-09-29 7:14 ` Richard Weinberger 2013-09-29 17:19 ` Pádraig Brady 2013-12-13 22:58 ` Jörn Engel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox