diff mbox series

[24/27] lustre: llite: add selinux testing

Message ID 1623625897-17706-25-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: sync to 2.14.52 | expand

Commit Message

James Simmons June 13, 2021, 11:11 p.m. UTC
From: Sebastien Buisson <sbuisson@ddn.com>

New test sanity-selinux.sh aims at exercing SELinux support
on the client side, as implemented according to LU-5560.
This patch adds new fail_locs in CLIO.

WC-bug-id: https://jira.whamcloud.com/browse/LU-5560
Lustre-commit: bfca8338e5f2ae1b ("LU-5560 tests: add sanity-selinux.sh")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Signed-off-by: Saurabh Tandan <saurabh.tandan@intel.com>
Reviewed-on: http://review.whamcloud.com/15818
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/obd_support.h | 3 +++
 fs/lustre/llite/dir.c           | 2 ++
 fs/lustre/llite/namei.c         | 6 ++++++
 3 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h
index 188e552..1e8cebf 100644
--- a/fs/lustre/include/obd_support.h
+++ b/fs/lustre/include/obd_support.h
@@ -468,6 +468,9 @@ 
 #define OBD_FAIL_LLITE_LOST_LAYOUT			0x1407
 #define OBD_FAIL_LLITE_NO_CHECK_DEAD			0x1408
 #define OBD_FAIL_GETATTR_DELAY				0x1409
+#define OBD_FAIL_LLITE_CREATE_FILE_PAUSE		0x1409
+#define OBD_FAIL_LLITE_NEWNODE_PAUSE			0x140a
+#define OBD_FAIL_LLITE_SETDIRSTRIPE_PAUSE		0x140b
 #define OBD_FAIL_LLITE_CREATE_NODE_PAUSE		0x140c
 #define OBD_FAIL_LLITE_IMUTEX_SEC			0x140e
 #define OBD_FAIL_LLITE_IMUTEX_NOSEC			0x140f
diff --git a/fs/lustre/llite/dir.c b/fs/lustre/llite/dir.c
index 3432034..fa8e697 100644
--- a/fs/lustre/llite/dir.c
+++ b/fs/lustre/llite/dir.c
@@ -486,6 +486,8 @@  static int ll_dir_setdirstripe(struct dentry *dparent, struct lmv_user_md *lump,
 	if (err)
 		goto out_request;
 
+	CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_SETDIRSTRIPE_PAUSE, cfs_fail_val);
+
 	err = ll_prep_inode(&inode, &request->rq_pill, parent->i_sb, NULL);
 	if (err)
 		goto out_inode;
diff --git a/fs/lustre/llite/namei.c b/fs/lustre/llite/namei.c
index 9eab6fe..f42e872 100644
--- a/fs/lustre/llite/namei.c
+++ b/fs/lustre/llite/namei.c
@@ -1156,6 +1156,8 @@  static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
 	else if (de)
 		dentry = de;
 
+	CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_FILE_PAUSE, cfs_fail_val);
+
 	if (!rc) {
 		if (it_disposition(it, DISP_OPEN_CREATE)) {
 			/* Dentry instantiated in ll_create_it. */
@@ -1485,6 +1487,8 @@  static int ll_new_node(struct inode *dir, struct dentry *dentry,
 
 	ll_update_times(request, dir);
 
+	CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_NEWNODE_PAUSE, cfs_fail_val);
+
 	err = ll_prep_inode(&inode, &request->rq_pill, dir->i_sb, NULL);
 	if (err)
 		goto err_exit;
@@ -1575,6 +1579,8 @@  static int ll_create_nd(struct inode *dir, struct dentry *dentry,
 	ktime_t kstart = ktime_get();
 	int rc;
 
+	CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_FILE_PAUSE, cfs_fail_val);
+
 	CDEBUG(D_VFSTRACE,
 	       "VFS Op:name=%pd, dir=" DFID "(%p), flags=%u, excl=%d\n",
 	       dentry, PFID(ll_inode2fid(dir)), dir, mode, want_excl);