diff options
-rw-r--r-- | fs/affs/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/affs/file.c b/fs/affs/file.c index e87ede608f7..1a4f092f24e 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c | |||
@@ -539,7 +539,7 @@ affs_extent_file_ofs(struct inode *inode, u32 newsize) | |||
539 | tmp = min(bsize - boff, newsize - size); | 539 | tmp = min(bsize - boff, newsize - size); |
540 | BUG_ON(boff + tmp > bsize || tmp > bsize); | 540 | BUG_ON(boff + tmp > bsize || tmp > bsize); |
541 | memset(AFFS_DATA(bh) + boff, 0, tmp); | 541 | memset(AFFS_DATA(bh) + boff, 0, tmp); |
542 | AFFS_DATA_HEAD(bh)->size = cpu_to_be32(be32_to_cpu(AFFS_DATA_HEAD(bh)->size) + tmp); | 542 | be32_add_cpu(&AFFS_DATA_HEAD(bh)->size, tmp); |
543 | affs_fix_checksum(sb, bh); | 543 | affs_fix_checksum(sb, bh); |
544 | mark_buffer_dirty_inode(bh, inode); | 544 | mark_buffer_dirty_inode(bh, inode); |
545 | size += tmp; | 545 | size += tmp; |
@@ -680,7 +680,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping, | |||
680 | tmp = min(bsize - boff, to - from); | 680 | tmp = min(bsize - boff, to - from); |
681 | BUG_ON(boff + tmp > bsize || tmp > bsize); | 681 | BUG_ON(boff + tmp > bsize || tmp > bsize); |
682 | memcpy(AFFS_DATA(bh) + boff, data + from, tmp); | 682 | memcpy(AFFS_DATA(bh) + boff, data + from, tmp); |
683 | AFFS_DATA_HEAD(bh)->size = cpu_to_be32(be32_to_cpu(AFFS_DATA_HEAD(bh)->size) + tmp); | 683 | be32_add_cpu(&AFFS_DATA_HEAD(bh)->size, tmp); |
684 | affs_fix_checksum(sb, bh); | 684 | affs_fix_checksum(sb, bh); |
685 | mark_buffer_dirty_inode(bh, inode); | 685 | mark_buffer_dirty_inode(bh, inode); |
686 | written += tmp; | 686 | written += tmp; |