mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
ocfs2: do not fallback to buffer I/O write if appending
Now we can do direct io and do not fallback to buffered IO any more in case of append O_DIRECT write. Signed-off-by: Joseph Qi <joseph.qi@huawei.com> Cc: Weiwei Wang <wangww631@huawei.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Xuejiufei <xuejiufei@huawei.com> Cc: alex chen <alex.chen@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
49255dce65
commit
d943d59dd3
1 changed files with 4 additions and 1 deletions
|
@ -2116,6 +2116,9 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
|
||||||
struct dentry *dentry = file->f_path.dentry;
|
struct dentry *dentry = file->f_path.dentry;
|
||||||
struct inode *inode = dentry->d_inode;
|
struct inode *inode = dentry->d_inode;
|
||||||
loff_t saved_pos = 0, end;
|
loff_t saved_pos = 0, end;
|
||||||
|
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
|
||||||
|
int full_coherency = !(osb->s_mount_opt &
|
||||||
|
OCFS2_MOUNT_COHERENCY_BUFFERED);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We start with a read level meta lock and only jump to an ex
|
* We start with a read level meta lock and only jump to an ex
|
||||||
|
@ -2204,7 +2207,7 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
|
||||||
* one node could wind up truncating another
|
* one node could wind up truncating another
|
||||||
* nodes writes.
|
* nodes writes.
|
||||||
*/
|
*/
|
||||||
if (end > i_size_read(inode)) {
|
if (end > i_size_read(inode) && !full_coherency) {
|
||||||
*direct_io = 0;
|
*direct_io = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue