--- x/fs/open.c
+++ y/fs/open.c
@@ -952,6 +952,12 @@ static int do_dentry_open(struct file *f
 	if (!open)
 		open = f->f_op->open;
 	if (open) {
+		struct mount *mnt = real_mount(f->f_path.mnt);
+		error = -ENODEV;
+		if (mnt->mnt.mnt_flags & MNT_DOOMED)
+			goto cleanup_all;
+		if (mnt_get_count(mnt) < 2)
+			goto cleanup_all;
 		error = open(inode, f);
 		if (error)
 			goto cleanup_all;