op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
ll_finish_md_op_data(op_data);
- if (!rc)
- ll_update_times(request, dir);
+ if (!rc) {
+ struct mdt_body *body;
- ptlrpc_req_finished(request);
- if (!rc)
+ ll_update_times(request, dir);
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR,
ktime_us_delta(ktime_get(), kstart));
+
+ /*
+ * 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);
+ }
+
+ ptlrpc_req_finished(request);
+
RETURN(rc);
}
awk '/lustre_inode_cache/ { print $2; exit }' /proc/slabinfo
}
-test_76() { # Now for b=20433, added originally in b=1443
+test_76a() { # Now for b=20433, added originally in b=1443
[ $PARALLEL == "yes" ] && skip "skip parallel run"
cancel_lru_locks osc
fi
done
}
-run_test 76 "confirm clients recycle inodes properly ===="
+run_test 76a "confirm clients recycle inodes properly ===="
+test_76b() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run"
+ [ $CLIENT_VERSION -ge $(version_code 2.13.55) ] || skip "not supported"
+
+ local count=512
+ local before=$(num_objects)
+
+ for i in $(seq $count); do
+ mkdir $DIR/$tdir
+ rmdir $DIR/$tdir
+ done
+
+ local after=$(num_objects)
+ local wait=0
+
+ while (( after > before )); do
+ sleep 1
+ after=$(num_objects)
+ wait=$((wait + 1))
+ (( wait % 5 == 0 )) && echo "wait $wait seconds objects: $after"
+ if (( wait > 60 )); then
+ error "inode slab grew from $before to $after"
+ fi
+ done
+
+ echo "slab objects before: $before, after: $after"
+}
+run_test 76b "confirm clients recycle directory inodes properly ===="
export ORIG_CSUM=""
set_checksums()