diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index 69df240e49b596b67faa488ade7900115a5d0588..4ffd16652658b594bd289b8f4711870bdd0b6c30 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -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 { diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 7a41f07793ee16bd29687256d5dd009848aa2346..04c205f96aded8080aa772f5bf57911f11a172f0 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -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++; diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index ff77e088f956a52f1056fab826b6bf54727c5d9a..b47146848187499521042660ae3a89aebd721cf1 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -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)) {