diff mbox series

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

Message ID 154701504152.26726.5389367058165286948.stgit@noble (mailing list archive)
State New, archived
Headers show
Series assorted osc cleanups. | expand

Commit Message

NeilBrown Jan. 9, 2019, 6:24 a.m. UTC
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@suse.com>
---
 drivers/staging/lustre/lustre/osc/osc_cache.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Andreas Dilger Jan. 10, 2019, 2:07 a.m. UTC | #1
On Jan 8, 2019, at 23:24, NeilBrown <neilb@suse.com> wrote:
> 
> 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@suse.com>

Reviewed-by: Andreas Dilger <adilger@whamcloud.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);
> 
> 

Cheers, Andreas
---
Andreas Dilger
Principal Lustre Architect
Whamcloud
diff mbox series

Patch

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);