From fc75c4b4f597f095fc16d6119427f17f0d8e2a85 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Wed, 6 Aug 2014 14:01:48 -0500 Subject: [PATCH] LU-5456 hsm: hold inode mutex around ll_setattr_raw() ll_setattr_raw() expects to be called with the inode mutex held so do when calling it from ll_hsm_import(). Signed-off-by: John L. Hammond Change-Id: I91ef3d431fdf6db23bf4be6e957f2981d3e016cd Reviewed-on: http://review.whamcloud.com/11349 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jinshan Xiong Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin --- lustre/llite/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 3418966..dfb638a 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -2306,10 +2306,14 @@ static int ll_hsm_import(struct inode *inode, struct file *file, ATTR_MTIME | ATTR_MTIME_SET | ATTR_ATIME | ATTR_ATIME_SET; + mutex_lock(&inode->i_mutex); + rc = ll_setattr_raw(file->f_dentry, attr, true); if (rc == -ENODATA) rc = 0; + mutex_unlock(&inode->i_mutex); + out: if (hss != NULL) OBD_FREE_PTR(hss); -- 1.8.3.1