From: lsy Date: Mon, 29 Aug 2005 10:33:29 +0000 (+0000) Subject: minor fix: X-Git-Tag: 1.4.10~627 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=11d21db1c6721cef0426710b291980d31133e1ed;p=fs%2Flustre-release.git minor fix: * for partial write only search capability once. --- diff --git a/lustre/obdclass/capa.c b/lustre/obdclass/capa.c index b832580..24d34ec 100644 --- a/lustre/obdclass/capa.c +++ b/lustre/obdclass/capa.c @@ -96,7 +96,7 @@ find_capa(struct hlist_head *head, uid_t uid, int capa_op, __u64 mdsid, continue; if (ocapa->c_capa.lc_mdsid != mdsid) continue; - if (ocapa->c_capa.lc_op != capa_op) + if ((ocapa->c_capa.lc_op & capa_op) != ocapa->c_capa.lc_op) continue; if (ocapa->c_type != type) continue; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 8a49e36..70ce8a4 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -810,18 +810,11 @@ static int osc_brw_prep_request(int cmd, struct obd_import *imp,struct obdo *oa, /* TODO: this could be optimized: thie capability can be * found from ll_inode_info->lli_capas. */ - capa_op = (opc == OST_WRITE) ? CAPA_WRITE : CAPA_READ; -get_capa: + /* partial write might cause read, both CAPA_READ and CAPA_WRITE + * capability could be used here */ + capa_op = (opc == OST_WRITE) ? CAPA_WRITE : CAPA_READ | CAPA_WRITE; ocapa = capa_get(oa->o_fsuid, capa_op, raw_id->li_fid.lf_group, raw_id->li_stc.u.e3s.l3s_ino, CLIENT_CAPA); - if (!ocapa) { - if (opc == OST_READ && capa_op == MAY_READ) { - /* partial write might cause read, MAY_WRITE capability - * should be used here */ - capa_op = MAY_WRITE; - goto get_capa; - } - } size[bufcnt++] = sizeof(*body); size[bufcnt++] = sizeof(*ioobj);