From 092ecd66127eade284550b83192fa004ff55501b Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 16 Jul 2019 12:28:25 -0400 Subject: [PATCH] LU-12462 osc: Do not assert for first extent In the discard case, the OSC fsync/writeback code asserts that each OSC extent is fully covered by the fsync request. This is not valid for the DOM case, because OSC extent alignment requirements can create OSC extents which start before the OST region of the layout (ie, they cross in to the DOM region). This is OK because the layout prevents them from ever being used for i/o, but this same behavior means that the OSC fsync start/end is aligned with the layout, and so does not necessarily cover that first extent. The simplest solution is just to not assert on the first extent. (There is no way at the OSC layer to recognize the DOM case.) Signed-off-by: Patrick Farrell Change-Id: If66f8d81fb9dd4546a5647a10f6ca551e2cf98e3 Reviewed-on: https://review.whamcloud.com/35525 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Andriy Skulysh Reviewed-by: Oleg Drokin --- lustre/osc/osc_cache.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index ef3b2c0..041abf5 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -3038,9 +3038,16 @@ int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj, unplug = true; } else { /* the only discarder is lock cancelling, so - * [start, end] must contain this extent */ - EASSERT(ext->oe_start >= start && - ext->oe_end <= end, ext); + * [start, end] must contain this extent. + * However, with DOM, osc extent alignment may + * cause the first extent to start before the + * OST portion of the layout. This is never + * accessed for i/o, but the unused portion + * will not be covered by the sync request, + * so we cannot assert in that case. */ + EASSERT(ergo(!(ext == first_extent(obj)), + ext->oe_start >= start && + ext->oe_end <= end), ext); osc_extent_state_set(ext, OES_LOCKING); ext->oe_owner = current; list_move_tail(&ext->oe_link, -- 1.8.3.1