[lustre-devel] [PATCH 09/29] lustre: osc: remove test on 'found' being an error.

NeilBrown neilb at suse.com
Tue Jan 8 22:24:01 PST 2019


Found cannot be IS_ERR() at this point in the code, as it is only ever
assigned a value from osc_extent_hold() (or NULL).

So discard the test.

Signed-off-by: NeilBrown <neilb at suse.com>
---
 drivers/staging/lustre/lustre/osc/osc_cache.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 848e440ae2a9..e65d917336b9 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -821,11 +821,9 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
 	osc_extent_tree_dump(D_CACHE, obj);
 	if (found) {
 		LASSERT(!conflict);
-		if (!IS_ERR(found)) {
-			LASSERT(found->oe_dlmlock == cur->oe_dlmlock);
-			OSC_EXTENT_DUMP(D_CACHE, found,
-					"found caching ext for %lu.\n", index);
-		}
+		LASSERT(found->oe_dlmlock == cur->oe_dlmlock);
+		OSC_EXTENT_DUMP(D_CACHE, found,
+				"found caching ext for %lu.\n", index);
 	} else if (!conflict) {
 		/* create a new extent */
 		EASSERT(osc_extent_is_overlapped(obj, cur) == 0, cur);




More information about the lustre-devel mailing list