linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Making linkat() able to overwrite the target
@ 2020-01-14 16:34 David Howells
  2020-01-14 17:02 ` Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: David Howells @ 2020-01-14 16:34 UTC (permalink / raw)
  To: linux-fsdevel, viro, hch, tytso, adilger.kernel, darrick.wong,
	clm, josef, dsterba
  Cc: dhowells, linux-ext4, linux-xfs, linux-btrfs, linux-kernel

With my rewrite of fscache and cachefiles:

	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=fscache-iter

when a file gets invalidated by the server - and, under some circumstances,
modified locally - I have the cache create a temporary file with vfs_tmpfile()
that I'd like to just link into place over the old one - but I can't because
vfs_link() doesn't allow you to do that.  Instead I have to either unlink the
old one and then link the new one in or create it elsewhere and rename across.

Would it be possible to make linkat() take a flag, say AT_LINK_REPLACE, that
causes the target to be replaced and not give EEXIST?  Or make it so that
rename() can take a tmpfile as the source and replace the target with that.  I
presume that, either way, this would require journal changes on ext4, xfs and
btrfs.

Thanks,
David


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

end of thread, other threads:[~2020-01-17 16:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14 16:34 Making linkat() able to overwrite the target David Howells
2020-01-14 17:02 ` Al Viro
2020-01-14 18:06 ` David Howells
2020-01-14 19:37   ` Miklos Szeredi
2020-01-17  0:46   ` Colin Walters
2020-01-17  9:57     ` Amir Goldstein
2020-01-17 11:42   ` David Howells
2020-01-17 16:22     ` Omar Sandoval
2020-01-17 16:39     ` David Howells
2020-01-15  8:36 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).