Commit f2405598 authored by Michael Holzheu's avatar Michael Holzheu Committed by Martin Schwidefsky

[S390] vmur: reject open on z/VM reader files with status HOLD

If a reader file with HOLD status is at the top of the reader queue, currently
all read requests will return data of the second file in the queue. But the
semantics of vmur is that always the topmost file is read. With this fix
-EPERM is returned on open, if the topmost reader file is in HOLD status.
Signed-off-by: default avatarMichael Holzheu <holzheu@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 278bc68c
...@@ -556,7 +556,9 @@ static int verify_device(struct urdev *urd) ...@@ -556,7 +556,9 @@ static int verify_device(struct urdev *urd)
rc = diag_read_next_file_info(&fcb, 0); rc = diag_read_next_file_info(&fcb, 0);
if (rc) if (rc)
return rc; return rc;
/* if file is in hold status, we do not read it */
if (fcb.file_stat & (FLG_SYSTEM_HOLD | FLG_USER_HOLD))
return -EPERM;
/* open file on virtual reader */ /* open file on virtual reader */
buf = kmalloc(PAGE_SIZE, GFP_KERNEL); buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf) if (!buf)
......
...@@ -50,7 +50,9 @@ struct file_control_block { ...@@ -50,7 +50,9 @@ struct file_control_block {
char rest[200]; char rest[200];
} __attribute__ ((packed)); } __attribute__ ((packed));
#define FLG_CP_DUMP 0x10 #define FLG_SYSTEM_HOLD 0x04
#define FLG_CP_DUMP 0x10
#define FLG_USER_HOLD 0x20
/* /*
* A struct urdev is created for each ur device that is made available * A struct urdev is created for each ur device that is made available
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment