changeset 13828:9b04683eb903

3160 nfs: OPEN_CONFIRM with non-regular file returns wrong error Reviewed by: Eric Schrock <eric.schrock@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Daniil Lunev <d.lunev.mail@gmail.com>
date Wed, 05 Sep 2012 20:55:01 -0500
parents 9eaeead74954
children f77936ab6455
files usr/src/uts/common/fs/nfs/nfs4_srv.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs4_srv.c	Thu Sep 06 10:41:18 2012 -0500
+++ b/usr/src/uts/common/fs/nfs/nfs4_srv.c	Wed Sep 05 20:55:01 2012 -0500
@@ -7620,6 +7620,12 @@
 		goto out;
 	}
 
+	if (cs->vp->v_type != VREG) {
+		*cs->statusp = resp->status =
+		    cs->vp->v_type == VDIR ? NFS4ERR_ISDIR : NFS4ERR_INVAL;
+		return;
+	}
+
 	status = rfs4_get_state(&args->open_stateid, &sp, RFS4_DBS_VALID);
 	if (status != NFS4_OK) {
 		*cs->statusp = resp->status = status;