ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 1/1] Ocfs2: Correctly treat O_DIRECT write in holes or outside 'i_size'.
@ 2010-08-19  1:14 Tristan Ye
  2010-08-19  2:40 ` Tao Ma
  0 siblings, 1 reply; 2+ messages in thread
From: Tristan Ye @ 2010-08-19  1:14 UTC (permalink / raw)
  To: ocfs2-devel

Currently, O_DIRECT writes in a hole or outside the 'i_size' was not
actually honored, while using a buffered io instead.

It hurts/cheats the 'O_DIRECT' semantics somehow, users may be confusing
about the data lost after a crash when performing the odirect append writes.

A straightforward way is to flush the pagecache like O_SYNC did to guarantee
the real touch to disk before writes get returned.

Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
---
 fs/ocfs2/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 2b10b36..97b41f8 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2321,7 +2321,7 @@ out_dio:
 	BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT));
 
 	if (((file->f_flags & O_DSYNC) && !direct_io) || IS_SYNC(inode) ||
-	    ((file->f_flags & O_DIRECT) && has_refcount)) {
+	    ((file->f_flags & O_DIRECT) && !direct_io)) {
 		ret = filemap_fdatawrite_range(file->f_mapping, pos,
 					       pos + count - 1);
 		if (ret < 0)
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] Ocfs2: Correctly treat O_DIRECT write in holes or outside 'i_size'.
  2010-08-19  1:14 [Ocfs2-devel] [PATCH 1/1] Ocfs2: Correctly treat O_DIRECT write in holes or outside 'i_size' Tristan Ye
@ 2010-08-19  2:40 ` Tao Ma
  0 siblings, 0 replies; 2+ messages in thread
From: Tao Ma @ 2010-08-19  2:40 UTC (permalink / raw)
  To: ocfs2-devel



On 08/19/2010 09:14 AM, Tristan Ye wrote:
> Currently, O_DIRECT writes in a hole or outside the 'i_size' was not
> actually honored, while using a buffered io instead.
>
> It hurts/cheats the 'O_DIRECT' semantics somehow, users may be confusing
> about the data lost after a crash when performing the odirect append writes.
>
> A straightforward way is to flush the pagecache like O_SYNC did to guarantee
> the real touch to disk before writes get returned.
well, actually it is a regression bug.
So tristan, could you please describe the commit that trigger it and the 
real problem that I describe in the bugzilla. Also please mention the 
bug no.
 From this commit log, it seems that we are bad from the very beginning 
which isn't true. ;)

Regards,
Tao
>
> Signed-off-by: Tristan Ye<tristan.ye@oracle.com>
> ---
>   fs/ocfs2/file.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
> index 2b10b36..97b41f8 100644
> --- a/fs/ocfs2/file.c
> +++ b/fs/ocfs2/file.c
> @@ -2321,7 +2321,7 @@ out_dio:
>   	BUG_ON(ret == -EIOCBQUEUED&&  !(file->f_flags&  O_DIRECT));
>
>   	if (((file->f_flags&  O_DSYNC)&&  !direct_io) || IS_SYNC(inode) ||
> -	    ((file->f_flags&  O_DIRECT)&&  has_refcount)) {
> +	    ((file->f_flags&  O_DIRECT)&&  !direct_io)) {
>   		ret = filemap_fdatawrite_range(file->f_mapping, pos,
>   					       pos + count - 1);
>   		if (ret<  0)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-19  2:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19  1:14 [Ocfs2-devel] [PATCH 1/1] Ocfs2: Correctly treat O_DIRECT write in holes or outside 'i_size' Tristan Ye
2010-08-19  2:40 ` Tao Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).