[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: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by Michael Holzheu and committed by Martin Schwidefsky f2405598 278bc68c

+6 -2
+3 -1
drivers/s390/char/vmur.c
··· 556 556 rc = diag_read_next_file_info(&fcb, 0); 557 557 if (rc) 558 558 return rc; 559 - 559 + /* if file is in hold status, we do not read it */ 560 + if (fcb.file_stat & (FLG_SYSTEM_HOLD | FLG_USER_HOLD)) 561 + return -EPERM; 560 562 /* open file on virtual reader */ 561 563 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); 562 564 if (!buf)
+3 -1
drivers/s390/char/vmur.h
··· 50 50 char rest[200]; 51 51 } __attribute__ ((packed)); 52 52 53 - #define FLG_CP_DUMP 0x10 53 + #define FLG_SYSTEM_HOLD 0x04 54 + #define FLG_CP_DUMP 0x10 55 + #define FLG_USER_HOLD 0x20 54 56 55 57 /* 56 58 * A struct urdev is created for each ur device that is made available