diff options
author | takawata <takawata@FreeBSD.org> | 2004-10-05 05:59:29 +0000 |
---|---|---|
committer | takawata <takawata@FreeBSD.org> | 2004-10-05 05:59:29 +0000 |
commit | 58f5d3f21685e512bc226f042c10d57e06bc3ba9 (patch) | |
tree | c4461ddb3400baa80838ad958f09a8ef4f580937 /sys/fs/unionfs/union_vfsops.c | |
parent | 6834dc4a7a573439bc3009b71986be5e2a4a102e (diff) | |
download | FreeBSD-src-58f5d3f21685e512bc226f042c10d57e06bc3ba9.zip FreeBSD-src-58f5d3f21685e512bc226f042c10d57e06bc3ba9.tar.gz |
Fix unionfs problems when a directory is mounted on other directory
with different file systems. This may cause ill things
with my previous fix. Now it translate fsid of direct child of
mount point directory only.
Pointed out by: Uwe Doering
Diffstat (limited to 'sys/fs/unionfs/union_vfsops.c')
-rw-r--r-- | sys/fs/unionfs/union_vfsops.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 1b5293e..bf3fcfa 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -72,6 +72,7 @@ union_mount(mp, td) struct vnode *lowerrootvp = NULLVP; struct vnode *upperrootvp = NULLVP; struct union_mount *um = 0; + struct vattr va; struct ucred *cred = 0; char *cp = 0, *target; int op; @@ -191,6 +192,12 @@ union_mount(mp, td) um->um_op = op; + error = VOP_GETATTR(upperrootvp, &va, td->td_ucred, td); + if (error) + goto bad; + + um->um_upperdev = va.va_fsid; + switch (um->um_op) { case UNMNT_ABOVE: um->um_lowervp = lowerrootvp; |