diff options
author | wang di <di.wang@intel.com> | 2016-09-18 16:38:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-19 10:03:41 +0200 |
commit | 8ef9dbe4b0ce3d9cae87251184096bfdaff75c9e (patch) | |
tree | fadb4d24c9da2775f21e1067d159b26b78b89b98 /drivers/staging/lustre | |
parent | fee58df692924d3dbefe45c55dab9b03dde54074 (diff) | |
download | linux-8ef9dbe4b0ce3d9cae87251184096bfdaff75c9e.tar.gz linux-8ef9dbe4b0ce3d9cae87251184096bfdaff75c9e.tar.bz2 linux-8ef9dbe4b0ce3d9cae87251184096bfdaff75c9e.zip |
staging: lustre: llite: lock the inode to be migrated
Because the inode and its connected dentries will be cleared
out of the cache after migration, the inode needs to be locked
during the migration.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4712
Reviewed-on: http://review.whamcloud.com/9689
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/file.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index d8761b83c233..5d4d17f2de61 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -2802,11 +2802,15 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, qstr.name = name; qstr.len = namelen; dchild = d_lookup(file_dentry(file), &qstr); - if (dchild && dchild->d_inode) { + if (dchild) { op_data->op_fid3 = *ll_inode2fid(dchild->d_inode); if (dchild->d_inode) { child_inode = igrab(dchild->d_inode); - ll_invalidate_aliases(child_inode); + if (child_inode) { + inode_lock(child_inode); + op_data->op_fid3 = *ll_inode2fid(child_inode); + ll_invalidate_aliases(child_inode); + } } dput(dchild); } else { @@ -2847,6 +2851,7 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, out_free: if (child_inode) { clear_nlink(child_inode); + inode_unlock(child_inode); iput(child_inode); } |