+ /* libsysio require us generate inode right away if success.
+ * so if mds created new inode for us we need make sure it
+ * succeeded. thus for any error we can't delay to the
+ * llu_file_open() time. */
+ if (it_disposition(it, DISP_OPEN_CREATE) &&
+ it_open_error(DISP_OPEN_CREATE, it)) {
+ CDEBUG(D_INODE, "detect mds create error\n");
+ return it_open_error(DISP_OPEN_CREATE, it);
+ }
+ if (it_disposition(it, DISP_OPEN_OPEN) &&
+ it_open_error(DISP_OPEN_OPEN, it)) {
+ CDEBUG(D_INODE, "detect mds open error\n");
+ /* undo which did by md_intent_lock */
+ if (it_disposition(it, DISP_OPEN_CREATE) &&
+ !it_open_error(DISP_OPEN_CREATE, it)) {
+ LASSERT(request);
+ LASSERT(atomic_read(&request->rq_refcount) > 1);
+ CDEBUG(D_INODE, "dec a ref of req %p\n", request);
+ ptlrpc_req_finished(request);
+ }
+ return it_open_error(DISP_OPEN_OPEN, it);
+ }
+