From ce6ecb553b85ea158af28c22827b93135a75d159 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Mon, 15 May 2017 17:30:29 -0400 Subject: [PATCH] rgw_file: v3: fix write-timer action For now, unify with v4 write-on-close path, by calling RGWFileHandle::close() on write-timer expire, since it will call write_finish() as a side-effect. Fixes: http://tracker.ceph.com/issues/19932 Signed-off-by: Matt Benjamin --- src/rgw/rgw_file.cc | 2 ++ src/rgw/rgw_file.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 3fe8ba05591..db66f852f62 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -1150,6 +1150,8 @@ namespace rgw { int rc = write_finish(FLAG_LOCKED); flags &= ~FLAG_OPEN; + flags &= ~FLAG_STATELESS_OPEN; + return rc; } /* RGWFileHandle::close */ diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 433356344e2..d063b1a6c3c 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -778,7 +778,7 @@ namespace rgw { } void operator()() { - rgw_fh.write_finish(); + rgw_fh.close(); /* will finish in-progress write */ rgw_fh.get_fs()->unref(&rgw_fh); } };