Whamcloud - gitweb
LU-1795 lustre: remove LASSERT in dt_fiemap_get()
authorMinh Diep <mdiep@whamcloud.com>
Wed, 29 Aug 2012 15:52:27 +0000 (08:52 -0700)
committerOleg Drokin <green@whamcloud.com>
Sun, 2 Sep 2012 16:37:56 +0000 (12:37 -0400)
dt_fiemap_get should return EOPNOTSUPP instead of
issuing a LASSERT when it's not supported on the
underlying filesystem

Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Change-Id: I2cd5044472af3deeb77dbc54ced93f7e553586aa
Reviewed-on: http://review.whamcloud.com/3817
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/include/dt_object.h

index f95563a..c57fc00 100644 (file)
@@ -1114,7 +1114,8 @@ static inline int dt_fiemap_get(const struct lu_env *env, struct dt_object *d,
         LASSERT(d);
         if (d->do_body_ops == NULL)
                 return -EPROTO;
-        LASSERT(d->do_body_ops->dbo_fiemap_get);
+       if (d->do_body_ops->dbo_fiemap_get == NULL)
+               return -EOPNOTSUPP;
         return d->do_body_ops->dbo_fiemap_get(env, d, fm);
 }