Re: [PATCH for testing] cow behaviour for hard links

From: Jamie Lokier
Date: Wed Mar 10 2004 - 16:36:03 EST


Jörn Engel wrote:
> Yeah, well, here it is, sortof. It works on file granularity instead
> of block, doesn't do the cow part inside the kernel (userspace get's
> an error and has to do it). But it works for ext2 and ext3 and is
> relatively short.
>
> Interna:
> I introduced a new flag for inodes, switching between normal behaviour
> and cow for hard links. Flag can be changed and queried per fcntl().
> Ext[23] needed a bit of tweaking to write this flag to disk. open()
> will fail, when a) cowlink flags is set, b) inode has more than one
> link and c) write access is requested.

I like the idea!

I keep many hard-linked kernel trees, and local version management is
done by "cp -rl" to make new trees and then change a few files in
those trees, compile, test etc. To prevent changes in one tree
accidentally affecting other trees, I "chmod -R a-r" all but the tree
I'm currently working on.

Thats works quite nicely, but it'd be even nicer to not need the
"chmod", and just be confident that writes won't clobber files in
another tree by accident.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/