From: John L. Hammond Date: Wed, 6 Aug 2014 19:01:48 +0000 (-0500) Subject: LU-5456 hsm: hold inode mutex around ll_setattr_raw() X-Git-Tag: 2.6.51~13 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=fc75c4b4f597f095fc16d6119427f17f0d8e2a85;p=fs%2Flustre-release.git 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 --- 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);