]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] vmur: reject open on z/VM reader files with status HOLD
authorMichael Holzheu <holzheu@de.ibm.com>
Fri, 10 Aug 2007 12:32:32 +0000 (14:32 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 10 Aug 2007 12:32:37 +0000 (14:32 +0200)
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>
drivers/s390/char/vmur.c
drivers/s390/char/vmur.h

index 27b8bf927415544db0c813dc412436ca91f20154..04395c0f99d8900b5e0b7249673e3836e0b0c272 100644 (file)
@@ -556,7 +556,9 @@ static int verify_device(struct urdev *urd)
                rc = diag_read_next_file_info(&fcb, 0);
                if (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  */
                buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
                if (!buf)
index 16d0a4e38e40a17ec4943c3fed13f0cba8245e04..522a9dfaa27556d59a212ba15f3e4a08d72dd5df 100644 (file)
@@ -50,7 +50,9 @@ struct file_control_block {
        char  rest[200];
 } __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