static int ll_unlink(struct inode *dir, struct dentry *dchild)
{
struct qstr *name = &dchild->d_name;
- struct ptlrpc_request *request = NULL;
- struct md_op_data *op_data;
- int rc;
- ENTRY;
+ struct ptlrpc_request *request = NULL;
+ struct md_op_data *op_data;
+ struct mdt_body *body;
+ int rc;
+ ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p)\n",
name->len, name->name, PFID(ll_inode2fid(dir)), dir);
- /*
- * XXX: unlink bind mountpoint maybe call to here,
- * just check it as vfs_unlink does.
- */
+ /*
+ * XXX: unlink bind mountpoint maybe call to here,
+ * just check it as vfs_unlink does.
+ */
if (unlikely(d_mountpoint(dchild)))
RETURN(-EBUSY);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
- if (dchild->d_inode != NULL)
- op_data->op_fid3 = *ll_inode2fid(dchild->d_inode);
+ op_data->op_fid3 = *ll_inode2fid(dchild->d_inode);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
if (rc)
GOTO(out, rc);
- ll_update_times(request, dir);
- ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_UNLINK, 1);
+ /*
+ * The server puts attributes in on the last unlink, use them to update
+ * the link count so the inode can be freed immediately.
+ */
+ body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
+ if (body->mbo_valid & OBD_MD_FLNLINK)
+ set_nlink(dchild->d_inode, body->mbo_nlink);
- out:
- ptlrpc_req_finished(request);
- RETURN(rc);
+ ll_update_times(request, dir);
+ ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_UNLINK, 1);
+
+out:
+ ptlrpc_req_finished(request);
+ RETURN(rc);
}
static int ll_rename(struct inode *src, struct dentry *src_dchild,
ALWAYS_EXCEPT=" 42a 42b 42c 45 68b $SANITY_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-# skipped tests: LU-2036 LU-8411 LU-9096 LU-9054
-ALWAYS_EXCEPT=" 76 407 253 312 $ALWAYS_EXCEPT"
+# skipped tests: LU-8411 LU-9096 LU-9054
+ALWAYS_EXCEPT=" 407 253 312 $ALWAYS_EXCEPT"
# Check Grants after these tests
GRANT_CHECK_LIST="$GRANT_CHECK_LIST 42a 42b 42c 42d 42e 63a 63b 64a 64b 64c"
awk '/lustre_inode_cache/ {print $2; exit}' /proc/slabinfo
}
-get_inode_slab_tunables() {
- awk '/lustre_inode_cache/ {print $9," ",$10," ",$11; exit}' /proc/slabinfo
-}
-
-set_inode_slab_tunables() {
- echo "lustre_inode_cache $1" > /proc/slabinfo
-}
-
test_76() { # Now for bug 20433, added originally in bug 1443
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- local SLAB_SETTINGS=$(get_inode_slab_tunables)
local CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
- # we cannot set limit below 1 which means 1 inode in each
- # per-cpu cache is still allowed
- set_inode_slab_tunables "1 1 0"
cancel_lru_locks osc
BEFORE_INODES=$(num_inodes)
echo "before inodes: $BEFORE_INODES"
error "inode slab grew from $BEFORE_INODES to $AFTER_INODES"
fi
done
- set_inode_slab_tunables "$SLAB_SETTINGS"
}
run_test 76 "confirm clients recycle inodes properly ===="