Whamcloud - gitweb
LU-5456 hsm: hold inode mutex around ll_setattr_raw() 49/11349/2
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 6 Aug 2014 19:01:48 +0000 (14:01 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 12 Aug 2014 15:21:55 +0000 (15:21 +0000)
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 <john.hammond@intel.com>
Change-Id: I91ef3d431fdf6db23bf4be6e957f2981d3e016cd
Reviewed-on: http://review.whamcloud.com/11349
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/file.c

index 3418966..dfb638a 100644 (file)
@@ -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);