Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106099743
D28987.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D28987.diff
View Options
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -1423,7 +1423,7 @@
}
if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))
cnp->cn_flags |= SAVENAME;
- if ((cnp->cn_flags & MAKEENTRY) &&
+ if ((cnp->cn_flags & MAKEENTRY) && dvp != newvp &&
(cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) &&
attrflag != 0 && (newvp->v_type != VDIR || dattrflag != 0))
cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime,
@@ -1752,9 +1752,14 @@
}
}
if (!error) {
- if ((cnp->cn_flags & MAKEENTRY) && attrflag)
- cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime,
- NULL);
+ if ((cnp->cn_flags & MAKEENTRY) && attrflag) {
+ if (dvp != newvp)
+ cache_enter_time(dvp, newvp, cnp,
+ &nfsva.na_ctime, NULL);
+ else
+ printf("nfs_create: bogus NFS server returned "
+ "the directory as the new file object\n");
+ }
*ap->a_vpp = newvp;
} else if (NFS_ISV4(dvp)) {
error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid,
@@ -2126,7 +2131,11 @@
*/
if (VFSTONFS(vp->v_mount)->nm_negnametimeo != 0 &&
(cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) {
- cache_enter_time(tdvp, vp, cnp, &nfsva.na_ctime, NULL);
+ if (tdvp != vp)
+ cache_enter_time(tdvp, vp, cnp, &nfsva.na_ctime, NULL);
+ else
+ printf("nfs_link: bogus NFS server returned "
+ "the directory as the new link\n");
}
if (error && NFS_ISV4(vp))
error = nfscl_maperr(cnp->cn_thread, error, (uid_t)0,
@@ -2205,7 +2214,12 @@
*/
if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 &&
(cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) {
- cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, NULL);
+ if (dvp != newvp)
+ cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime,
+ NULL);
+ else
+ printf("nfs_symlink: bogus NFS server returned "
+ "the directory as the new file object\n");
}
return (error);
}
@@ -2278,9 +2292,15 @@
*/
if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 &&
(cnp->cn_flags & MAKEENTRY) &&
- attrflag != 0 && dattrflag != 0)
- cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime,
- &dnfsva.na_ctime);
+ attrflag != 0 && dattrflag != 0) {
+ if (dvp != newvp)
+ cache_enter_time(dvp, newvp, cnp,
+ &nfsva.na_ctime, &dnfsva.na_ctime);
+ else
+ printf("nfs_mkdir: bogus NFS server returned "
+ "the directory that the directory was "
+ "created in as the new file object\n");
+ }
*ap->a_vpp = newvp;
}
return (error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 9:45 AM (11 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15603487
Default Alt Text
D28987.diff (2 KB)
Attached To
Mode
D28987: add safetybelt checks for cache_enter_time() when an NFS server sends a bogus reply
Attached
Detach File
Event Timeline
Log In to Comment