File s390-tools-sles11sp2-cmsfs-fuse_big_writes.patch of Package s390-tools

Description: cmsfs-fuse: Fix big write requests 
Symptom:     Writing to a file can fail if cmsfs-fuse is mounted with the
             -o big_writes option.
Problem:     The record length for the next variable record can be wrong
             if the last written record was larger than the disk block size.
Solution:    Reset the record length after writing a record.
Problem-ID:  75938 
---
 cmsfs-fuse/cmsfs-fuse.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/cmsfs-fuse/cmsfs-fuse.c
+++ b/cmsfs-fuse/cmsfs-fuse.c
@@ -3666,8 +3666,11 @@ static int extend_block_variable(struct
 		f->vrstate->rlen -= rlen;
 
 		BUG(f->vrstate->rlen < 0);
-		if (!f->vrstate->rlen)
+		if (!f->vrstate->rlen) {
 			f->vrstate->record_state = RWS_RECORD_COMPLETE;
+			/* reset rlen for the next record */
+			rlen = get_record_len(f, size);
+		}
 
 		DEBUG("%s: wrote %d record bytes\n", __func__, rlen);
 		if (size <= 0)