int boffs;
int dirty_inode = 0;
struct ldiskfs_inode_info *ei = LDISKFS_I(inode);
- bool create, sparse;
+ bool create, sparse, sync = false;
if (write_NUL) {
/*
while (bufsize > 0) {
int credits = handle->h_buffer_credits;
- bool sync;
unsigned long last_block = (new_size == 0) ? 0 :
(new_size - 1) >> inode->i_blkbits;
bh = __ldiskfs_bread(handle, inode, block, flags);
create = true;
} else {
- if (sync)
+ if (sync) {
up(&ei->i_append_sem);
+ sync = false;
+ }
create = false;
}
if (IS_ERR_OR_NULL(bh)) {
boffs, size, (unsigned long)bh->b_size);
if (create) {
memset(bh->b_data, 0, bh->b_size);
- if (sync)
+ if (sync) {
up(&ei->i_append_sem);
+ sync = false;
+ }
}
memcpy(bh->b_data + boffs, buf, size);
err = ldiskfs_handle_dirty_metadata(handle, NULL, bh);
bufsize -= size;
buf += size;
}
- if (bh)
- brelse(bh);
+ if (sync)
+ up(&ei->i_append_sem);
+
+ if (bh)
+ brelse(bh);
if (write_NUL)
--new_size;