Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26767
b: refs/heads/master
c: c4374f8
h: refs/heads/master
i:
  26765: 4d10aed
  26763: 12269b8
  26759: 692cffb
  26751: 7682f21
v: v3
  • Loading branch information
Mark Fasheh committed May 17, 2006
1 parent b8eb077 commit f651bab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53013cba4118a5cfe8f7c7ea5e5bc1c48b160f76
refs/heads/master: c4374f8a6093fbee42ac4368b3ca180d1d0c7c6d
16 changes: 16 additions & 0 deletions trunk/fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,22 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
ocfs2_iocb_set_rw_locked(iocb);
}

/*
* We're fine letting folks race truncates and extending
* writes with read across the cluster, just like they can
* locally. Hence no rw_lock during read.
*
* Take and drop the meta data lock to update inode fields
* like i_size. This allows the checks down below
* generic_file_aio_read() a chance of actually working.
*/
ret = ocfs2_meta_lock(inode, NULL, NULL, 0);
if (ret < 0) {
mlog_errno(ret);
goto bail;
}
ocfs2_meta_unlock(inode, 0);

ret = generic_file_aio_read(iocb, buf, count, iocb->ki_pos);
if (ret == -EINVAL)
mlog(ML_ERROR, "generic_file_aio_read returned -EINVAL\n");
Expand Down

0 comments on commit f651bab

Please sign in to comment.