Whamcloud - gitweb
LU-2070 osp: debug for the issue
[fs/lustre-release.git] / lustre / obdfilter / filter_capa.c
index d99357e..0e23110 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +24,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -112,8 +110,9 @@ int filter_update_capa_key(struct obd_device *obd, struct lustre_capa_key *new)
         RETURN(0);
 }
 
-int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
-                     struct lustre_capa *capa, __u64 opc)
+int filter_auth_capa(struct obd_export *exp,
+                    struct lu_fid *fid, obd_seq seq,
+                    struct lustre_capa *capa, __u64 opc)
 {
         struct obd_device *obd = exp->exp_obd;
         struct filter_obd *filter = &obd->u.filter;
@@ -128,6 +127,9 @@ int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
         if (!fid_seq_is_mdt(seq))
                 RETURN(0);
 
+       if (capa == BYPASS_CAPA)
+               RETURN(0);
+
         /* capability is disabled */
         if (!filter->fo_fl_oss_capa)
                 RETURN(0);
@@ -228,8 +230,10 @@ int filter_auth_capa(struct obd_export *exp, struct lu_fid *fid, obd_seq seq,
 int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_seq seq,
                       struct lustre_capa *capa)
 {
-        int rc = 0;
-        ENTRY;
+       struct obd_device       *obd = exp->exp_obd;
+       struct filter_obd       *filter = &obd->u.filter;
+       int                     rc = 0;
+       ENTRY;
 
         /* skip capa check for llog and obdecho */
         if (!fid_seq_is_mdt(seq))
@@ -238,12 +242,14 @@ int filter_capa_fixoa(struct obd_export *exp, struct obdo *oa, obd_seq seq,
         if (!(exp->exp_connect_flags & OBD_CONNECT_OSS_CAPA))
                 RETURN(0);
 
+       /* capability is disabled */
+       if (!filter->fo_fl_oss_capa)
+               RETURN(0);
+
         if (unlikely(!capa))
                 RETURN(-EACCES);
 
         if (capa_flags(capa) == LC_ID_CONVERT) {
-                struct obd_device *obd = exp->exp_obd;
-                struct filter_obd *filter = &obd->u.filter;
                 struct filter_capa_key *k;
                 int found = 0;