linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Move across mount,sb
@ 2007-03-15  1:20 Jan Engelhardt
  2007-03-15  1:46 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Engelhardt @ 2007-03-15  1:20 UTC (permalink / raw)
  To: linux-fsdevel

Hello,


	touch /tmp/foo;
	mount /tmp /mnt --bind;
	strace -e rename mv /tmp/foo /mnt/bar

Ideally, I would expect, that since /tmp and /mnt are the same 
filesystem, that the move operation would complete without _copying_ the 
file. But strace returns

	rename("/tmp/foo", "/mnt/bar") = -1 EXDEV (Invalid cross-device link)

The piece of code identified is fs/namei.c:2578:do_rename()

	error = -EXDEV;
	if (oldnd.mnt != newnd.mnt)
		goto exit2;

Why is EXDEV returned when _vfs mountpoints_ are crossed? Should not it 
be more like the following?

	error = -EXDEV;
	if (oldnd.mnt->mnt_sb != newnd.mnt->mnt_sb)
		goto exit2;




Jan
-- 

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

end of thread, other threads:[~2007-03-15  1:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-15  1:20 Move across mount,sb Jan Engelhardt
2007-03-15  1:46 ` Al Viro

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).