diff mbox

ceph: improving efficiency of syncfs

Message ID 1517277750-144449-1-git-send-email-cgxu519@icloud.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chengguang Xu Jan. 30, 2018, 2:02 a.m. UTC
write_inode() could be called variety of reasons, in the case of syncfs(2)
there is no need to wait for flush getting completed in write_inode(),
->sync_fs is for guaranteeing flush completion for all inodes at that point.

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
---
 fs/ceph/caps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yan, Zheng Jan. 30, 2018, 7:05 a.m. UTC | #1
> On 30 Jan 2018, at 10:02, Chengguang Xu <cgxu519@icloud.com> wrote:
> 
> write_inode() could be called variety of reasons, in the case of syncfs(2)
> there is no need to wait for flush getting completed in write_inode(),
> ->sync_fs is for guaranteeing flush completion for all inodes at that point.
> 
> Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
> ---
> fs/ceph/caps.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index a14b2c9..fd6ce29 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -2160,7 +2160,7 @@ int ceph_write_inode(struct inode *inode, struct writeback_control *wbc)
> 	u64 flush_tid;
> 	int err = 0;
> 	int dirty;
> -	int wait = wbc->sync_mode == WB_SYNC_ALL;
> +	int wait = (wbc->sync_mode == WB_SYNC_ALL && !wbc->for_sync);
> 
> 	dout("write_inode %p wait=%d\n", inode, wait);
> 	if (wait) {
> -- 
> 1.8.3.1
> 

Applied, thanks

Yan, Zheng

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index a14b2c9..fd6ce29 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2160,7 +2160,7 @@  int ceph_write_inode(struct inode *inode, struct writeback_control *wbc)
 	u64 flush_tid;
 	int err = 0;
 	int dirty;
-	int wait = wbc->sync_mode == WB_SYNC_ALL;
+	int wait = (wbc->sync_mode == WB_SYNC_ALL && !wbc->for_sync);
 
 	dout("write_inode %p wait=%d\n", inode, wait);
 	if (wait) {