From: Shantonu Sen Date: Mon, 18 Oct 2004 06:00:50 +0000 (+0000) Subject: STABLE12-darwin-avoid-hang-on-rename-20040202 X-Git-Tag: openafs-stable-1_2_12~17 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5345e07dfc8740986651c9891567698c8af1d04d;p=packages%2Fo%2Fopenafs.git STABLE12-darwin-avoid-hang-on-rename-20040202 FIXES 2967 this version deals with afs being multiply mounted. return EXDEV on cross device rename attempts as upper layer doesn't deal for us (cherry picked from commit 43118d9396d26adf107530d49b60245b756d7455) --- diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index c14fddfac..8d23b7df5 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -887,6 +887,15 @@ afs_vop_rename(ap) register struct vnode *fdvp = ap->a_fdvp; struct proc *p=fcnp->cn_proc; + /* Check for cross-device rename. + * For AFS, this means anything not in AFS-space + */ + if ((0 != strcmp(tdvp->v_mount->mnt_stat.f_fstypename, "afs")) || + (tvp && (0 != strcmp(tvp->v_mount->mnt_stat.f_fstypename, "afs")))) { + error = EXDEV; + goto abortit; + } + /* * if fvp == tvp, we're just removing one name of a pair of * directory entries for the same element. convert call into rename.