Whamcloud - gitweb
LU-1597 obdfilter: fix some capa code for OST
authorBobi Jam <bobijam@whamcloud.com>
Thu, 12 Jul 2012 03:51:20 +0000 (11:51 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 28 Nov 2012 19:21:05 +0000 (14:21 -0500)
* A capability should be set for filter_sync(), and when the operation
  is come from OSS itself, the capability check can be passed.
* filter_capa_fixoa() need check whether filter enabled capability.

port of master commit 27fe2e8d24e70af2377a52d411d53e332c3a3406

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Ie27497d2b61654a7f24c06f6975e8bfaf5e9ae13
Reviewed-on: http://review.whamcloud.com/3383
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdfilter/filter_capa.c
lustre/ost/ost_handler.c

index 6595374..6d9c5e5 100644 (file)
@@ -128,6 +128,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,6 +231,8 @@ 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)
 {
+        struct obd_device *obd = exp->exp_obd;
+        struct filter_obd *filter = &obd->u.filter;
         int rc = 0;
         ENTRY;
 
@@ -238,12 +243,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;
 
index e31e254..f0d391b 100644 (file)
@@ -1546,6 +1546,7 @@ int ost_blocking_ast(struct ldlm_lock *lock,
                 oa->o_seq = lock->l_resource->lr_name.name[1];
                 oa->o_valid = OBD_MD_FLID|OBD_MD_FLGROUP;
                 oinfo->oi_oa = oa;
+                oinfo->oi_capa = BYPASS_CAPA;
 
                 rc = obd_sync(lock->l_export, oinfo,
                               lock->l_policy_data.l_extent.start,