changeset 13827:9eaeead74954

3161 nfs: OPEN_DOWNGRADE 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 Thu, 06 Sep 2012 10:41:18 -0500
parents 23fd30d0ae03
children 9b04683eb903
files usr/src/uts/common/fs/nfs/nfs4_srv.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs4_srv.c	Tue Sep 04 21:55:34 2012 -0500
+++ b/usr/src/uts/common/fs/nfs/nfs4_srv.c	Thu Sep 06 10:41:18 2012 -0500
@@ -7735,6 +7735,11 @@
 		goto out;
 	}
 
+	if (cs->vp->v_type != VREG) {
+		*cs->statusp = resp->status = NFS4ERR_INVAL;
+		return;
+	}
+
 	status = rfs4_get_state(&args->open_stateid, &sp, RFS4_DBS_VALID);
 	if (status != NFS4_OK) {
 		*cs->statusp = resp->status = status;