Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2405598e0678e9c93dd780f2a12fc562ece3d13
Commit:     f2405598e0678e9c93dd780f2a12fc562ece3d13
Parent:     278bc68c4bfcd1af97972f5c4458acf3b9b19c37
Author:     Michael Holzheu <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 10 14:32:32 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Aug 10 14:32:37 2007 +0200

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/char/vmur.c |    4 +++-
 drivers/s390/char/vmur.h |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 27b8bf9..04395c0 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -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)
diff --git a/drivers/s390/char/vmur.h b/drivers/s390/char/vmur.h
index 16d0a4e..522a9df 100644
--- a/drivers/s390/char/vmur.h
+++ b/drivers/s390/char/vmur.h
@@ -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
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to