From 6c2bbc022832087f2ff0f65d83e3b0a460e45911 Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Tue, 14 Jun 2016 20:51:07 -0400 Subject: [PATCH 1/1] LU-8150 mdt: Track open+create as mknod Regular files created with mknod are tracked, but most files are created as an open with create intent. Track this as a mknod also. Signed-off-by: Matt Ezell Change-Id: I8f6ab9d91d0b31062c7f73f8394a1b12f7963f1c Reviewed-on: http://review.whamcloud.com/20246 Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_open.c | 3 ++- lustre/tests/sanity.sh | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 25938df..b305b57 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1416,7 +1416,8 @@ again: if (result != 0) GOTO(out_child, result); } - created = 1; + created = 1; + mdt_counter_incr(req, LPROC_MDT_MKNOD); } else { /* * The object is on remote node, return its FID for remote open. diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 0ada97c..87d9bad 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -9284,8 +9284,10 @@ test_133a() { touch ${testdir}/${tfile} || "touch failed" check_stats $SINGLEMDS "open" 1 check_stats $SINGLEMDS "close" 1 - mknod ${testdir}/${tfile}-pipe p || "mknod failed" - check_stats $SINGLEMDS "mknod" 1 + [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.8.54) ] && { + mknod ${testdir}/${tfile}-pipe p || "mknod failed" + check_stats $SINGLEMDS "mknod" 2 + } rm -f ${testdir}/${tfile}-pipe || "pipe remove failed" check_stats $SINGLEMDS "unlink" 1 rm -f ${testdir}/${tfile} || error "file remove failed" -- 1.8.3.1