public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: Don't use ceph-sync-mode for synchronous-fs.
@ 2013-06-27  7:56 majianpeng
       [not found] ` <201307161949279533980@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2013-06-27  7:56 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1506 bytes --]

At now for synchronous-fs, all write-operations use ceph_sync_mode.
But for the file which opened with O_SYNC, it don't use sync_mode.
The behaviour of them should be the same.
For fs which mounted using '-o sync', it want all I/O to the filesystem
should be done synchronously.But the ceph-sync-mode don't be suitful
for.For example,using ceph-sync-mode the content of file don't have in
memory.This will cause the following read only from osd rather than
memory.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 fs/ceph/file.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 656e169..44670ad 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -659,7 +659,6 @@ again:
 
 	if ((got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0 ||
 	    (iocb->ki_filp->f_flags & O_DIRECT) ||
-	    (inode->i_sb->s_flags & MS_SYNCHRONOUS) ||
 	    (fi->flags & CEPH_F_SYNC))
 		/* hmm, this isn't really async... */
 		ret = ceph_sync_read(filp, base, len, ppos, &checkeof);
@@ -764,7 +763,6 @@ retry_snap:
 
 	if ((got & (CEPH_CAP_FILE_BUFFER|CEPH_CAP_FILE_LAZYIO)) == 0 ||
 	    (iocb->ki_filp->f_flags & O_DIRECT) ||
-	    (inode->i_sb->s_flags & MS_SYNCHRONOUS) ||
 	    (fi->flags & CEPH_F_SYNC)) {
 		mutex_unlock(&inode->i_mutex);
 		written = ceph_sync_write(file, iov->iov_base, count,
-- 
1.8.1.2
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: Re: [PATCH] ceph: Don't use ceph-sync-mode for synchronous-fs.
       [not found]     ` <alpine.DEB.2.00.1307231812280.8332@cobra.newdream.net>
@ 2013-07-24  4:46       ` majianpeng
  0 siblings, 0 replies; 2+ messages in thread
From: majianpeng @ 2013-07-24  4:46 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 2408 bytes --]

>Hi,
>
>Sorry for the slow review.  The patch looks good, but I have a hard time 
>understanding your changelog... is it okay if I change it to something 
>like:
>
>
>Sending reads and writes through the sync read/write paths bypasses the 
>page cache, which is not expected or generally a good idea.  Removing 
>the write check is safe as there is a conditional vfs_fsync_range() later 
>in ceph_aio_write that already checks for the same flag (via 
>IS_SYNC(inode)).
>
Very good.
It's my fault. I will notice the message later.

Thanks !
Jianpeng Ma
>?
>
>Thanks!
>sage
>
>
>On Wed, 24 Jul 2013, majianpeng wrote:
>
>> Ping
>> >Hi sage,
>> >	How about this patch?Can you give some advisement?
>> >Thanks!
>> >Jianpeng Ma
>> >>At now for synchronous-fs, all write-operations use ceph_sync_mode.
>> >>But for the file which opened with O_SYNC, it don't use sync_mode.
>> >>The behaviour of them should be the same.
>> >>For fs which mounted using '-o sync', it want all I/O to the filesystem
>> >>should be done synchronously.But the ceph-sync-mode don't be suitful
>> >>for.For example,using ceph-sync-mode the content of file don't have in
>> >>memory.This will cause the following read only from osd rather than
>> >>memory.
>> >>
>> >>Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
>> >>---
>> >> fs/ceph/file.c | 2 --
>> >> 1 file changed, 2 deletions(-)
>> >>
>> >>diff --git a/fs/ceph/file.c b/fs/ceph/file.c
>> >>index 656e169..44670ad 100644
>> >>--- a/fs/ceph/file.c
>> >>+++ b/fs/ceph/file.c
>> >>@@ -659,7 +659,6 @@ again:
>> >> 
>> >> 	if ((got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0 ||
>> >> 	    (iocb->ki_filp->f_flags & O_DIRECT) ||
>> >>-	    (inode->i_sb->s_flags & MS_SYNCHRONOUS) ||
>> >> 	    (fi->flags & CEPH_F_SYNC))
>> >> 		/* hmm, this isn't really async... */
>> >> 		ret = ceph_sync_read(filp, base, len, ppos, &checkeof);
>> >>@@ -764,7 +763,6 @@ retry_snap:
>> >> 
>> >> 	if ((got & (CEPH_CAP_FILE_BUFFER|CEPH_CAP_FILE_LAZYIO)) == 0 ||
>> >> 	    (iocb->ki_filp->f_flags & O_DIRECT) ||
>> >>-	    (inode->i_sb->s_flags & MS_SYNCHRONOUS) ||
>> >> 	    (fi->flags & CEPH_F_SYNC)) {
>> >> 		mutex_unlock(&inode->i_mutex);
>> >> 		written = ceph_sync_write(file, iov->iov_base, count,
>> >>-- 
>> >>1.8.1.2ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

end of thread, other threads:[~2013-07-24  4:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-27  7:56 [PATCH] ceph: Don't use ceph-sync-mode for synchronous-fs majianpeng
     [not found] ` <201307161949279533980@gmail.com>
     [not found]   ` <201307240828220999500@gmail.com>
     [not found]     ` <alpine.DEB.2.00.1307231812280.8332@cobra.newdream.net>
2013-07-24  4:46       ` majianpeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox