summaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/vmur.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/vmur.c')
-rw-r--r--drivers/s390/char/vmur.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 04395c0f99d8..a9d58629e795 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -565,9 +565,14 @@ static int verify_device(struct urdev *urd)
return -ENOMEM;
rc = diag_read_file(urd->dev_id.devno, buf);
kfree(buf);
-
if ((rc != 0) && (rc != -ENODATA)) /* EOF does not hurt */
return rc;
+ /* check if the file on top of the queue is open now */
+ rc = diag_read_next_file_info(&fcb, 0);
+ if (rc)
+ return rc;
+ if (!(fcb.file_stat & FLG_IN_USE))
+ return -EMFILE;
return 0;
default:
return -ENOTSUPP;
OpenPOWER on IntegriCloud