ll_readahead_init(inode, &fd->fd_ras);
fd->fd_omode = it->it_flags;
- rc = ll_set_capa(inode, it);
RETURN(rc);
}
rc = ll_local_open(file, it, NULL);
if (rc)
LBUG();
+
+ rc = ll_set_capa(inode, it, *och_p);
+ if (rc) {
+ up(&lli->lli_och_sem);
+ RETURN(rc);
+ }
} else {
LASSERT(*och_usecount == 0);
OBD_ALLOC(*och_p, sizeof (struct obd_client_handle));
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_OPEN);
rc = ll_local_open(file, it, *och_p);
LASSERTF(rc == 0, "rc = %d\n", rc);
+
+ rc = ll_set_capa(inode, it, *och_p);
+ if (rc) {
+ up(&lli->lli_och_sem);
+ RETURN(rc);
+ }
}
up(&lli->lli_och_sem);
EXIT;
}
-int ll_set_capa(struct inode *inode, struct lookup_intent *it)
+int ll_set_capa(struct inode *inode, struct lookup_intent *it,
+ struct obd_client_handle *och)
{
struct ptlrpc_request *req = LUSTRE_IT(it)->it_data;
struct mds_body *body;
spin_lock(&capa_lock);
ocapa->c_inode = inode;
- ocapa->c_handle = body->handle;
+ ocapa->c_handle = och->och_fh;
spin_unlock(&capa_lock);
spin_lock(&lli->lli_lock);
void ll_capa_thread_stop(void);
void ll_capa_timer_callback(unsigned long unused);
-int ll_set_capa(struct inode *inode, struct lookup_intent *it);
+int ll_set_capa(struct inode *inode, struct lookup_intent *it,
+ struct obd_client_handle *och);
int ll_set_trunc_capa(struct ptlrpc_request *req, int offset,
struct inode *inode);
struct obd_capa *ll_get_capa(struct inode *inode, uid_t uid, int op);
if (OBD_FAIL_CHECK(OBD_FAIL_FILTER_VERIFY_CAPA))
RETURN(-EACCES);
- if (capa_expired(capa))
+ if (capa_expired(capa)) {
+ DEBUG_CAPA(D_INFO, capa, "expired");
RETURN(-ESTALE);
+ }
ocapa = capa_get(capa->lc_uid, capa->lc_op, capa->lc_mdsid,
capa->lc_ino, FILTER_CAPA);