Whamcloud - gitweb
Set MDS_BFLAG_EXT_FLAGS on MDS in open call path.
authorgirish <girish>
Wed, 10 Dec 2008 17:59:24 +0000 (17:59 +0000)
committergirish <girish>
Wed, 10 Dec 2008 17:59:24 +0000 (17:59 +0000)
b=17465
i=adilger
i=johann

lustre/include/lustre_export.h
lustre/mds/handler.c
lustre/mds/mds_open.c

index 69df240..4ffd166 100644 (file)
@@ -138,6 +138,8 @@ struct obd_export {
                                   exp_connecting:1,
                                   exp_replay_needed:1,
                                   exp_need_sync:1, /* needs sync from connect */
+                                  exp_bflag:1,     /* for 1.6 only to track
+                                                      MDS_BFLAG_EXT_FLAGS */
                                   exp_libclient:1; /* liblustre client? */
         struct list_head          exp_queued_rpc;  /* RPC to be handled */
         union {
index 7a41f07..04c205f 100644 (file)
@@ -764,6 +764,18 @@ static int mds_getattr_internal(struct obd_device *obd, struct dentry *dentry,
 
         mds_pack_inode2fid(&body->fid1, inode);
         body->flags = reqbody->flags; /* copy MDS_BFLAG_EXT_FLAGS if present */
+
+        /* Compatibility for clients that do not set BLFAG_EXT_FLAGS in
+         * intent lock requests even though they check it in the reply.
+         * In 1.8+ this is set unconditionally, but 1.4.6- clients do
+         * not understand this flag.  b=17465 */
+        if ((reqbody->flags & MDS_BFLAG_EXT_FLAGS) &&
+            !obd->obd_self_export->exp_bflag) {
+                spin_lock(&obd->obd_self_export->exp_lock);
+                obd->obd_self_export->exp_bflag = 1;
+                spin_unlock(&obd->obd_self_export->exp_lock);
+        }
+
         mds_pack_inode2body(body, inode);
         reply_off++;
 
index ff77e08..b471468 100644 (file)
@@ -1177,6 +1177,8 @@ int mds_open(struct mds_update_record *rec, int offset,
 
 found_child:
         mds_pack_inode2fid(&body->fid1, dchild->d_inode);
+        if (obd->obd_self_export->exp_bflag)
+                body->flags |= MDS_BFLAG_EXT_FLAGS;
         mds_pack_inode2body(body, dchild->d_inode);
 
         if (S_ISREG(dchild->d_inode->i_mode)) {