@@ -3866,6 +3866,8 @@ nfs4_upgrade_open(struct svc_rqst *rqstp, struct nfs4_file *fp, struct svc_fh *c
if (!test_access(open->op_share_access, stp))
return nfs4_get_vfs_file(rqstp, fp, cur_fh, stp, open);
+ WARN_ON_ONCE(!find_readable_file(fp));
+
/* test and set deny mode */
spin_lock(&fp->fi_lock);
status = nfs4_file_check_deny(fp, open->op_share_deny);
@@ -4171,6 +4173,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
init_open_stateid(stp, fp, open);
status = nfs4_get_vfs_file(rqstp, fp, current_fh, stp, open);
if (status) {
+ WARN_ON_ONCE(!find_readable_file(fp));
release_open_stateid(stp);
goto out;
}