diff options
author | Kevin Vigor <kvigor@fb.com> | 2017-01-05 12:21:20 -0800 |
---|---|---|
committer | Kevin Vigor <kvigor@fb.com> | 2017-01-05 12:21:20 -0800 |
commit | c27aa58e72cf528583c585691e65abdb765535e5 (patch) | |
tree | fae75e5b924ac4fb80a3d4ed42203638732fbb52 /api/src/glfs-resolve.c | |
parent | 63403742f53ec59a6acbe26ff4c39bab1b0842ed (diff) | |
parent | cb8bc3396d16e777d9a2683886fefd43e747e8a3 (diff) |
Merge remote-tracking branch 'origin/release-3.8' into merge-3.8-again
Change-Id: I844adf2aef161a44d446f8cd9b7ebcb224ee618a
Signed-off-by: Kevin Vigor <kvigor@fb.com>
Diffstat (limited to 'api/src/glfs-resolve.c')
-rw-r--r-- | api/src/glfs-resolve.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c index b84e5d8f58c..f8b437bab0e 100644 --- a/api/src/glfs-resolve.c +++ b/api/src/glfs-resolve.c @@ -784,7 +784,7 @@ glfs_resolve_fd (struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd) { fd_t *fd = NULL; - glfs_lock (fs); + glfs_lock (fs, _gf_true); { fd = __glfs_resolve_fd (fs, subvol, glfd); } @@ -897,12 +897,17 @@ priv_glfs_subvol_done (struct glfs *fs, xlator_t *subvol) if (!subvol) return; - glfs_lock (fs); + /* For decrementing subvol->wind ref count we need not check/wait for + * migration-in-progress flag. + * Also glfs_subvol_done is called in call-back path therefore waiting + * fot migration-in-progress flag can lead to dead-lock. + */ + glfs_lock (fs, _gf_false); { ref = (--subvol->winds); active_subvol = fs->active_subvol; } - glfs_unlock (fs); + glfs_unlock (fs); if (ref == 0) { assert (subvol != active_subvol); @@ -919,7 +924,7 @@ priv_glfs_active_subvol (struct glfs *fs) xlator_t *subvol = NULL; xlator_t *old_subvol = NULL; - glfs_lock (fs); + glfs_lock (fs, _gf_true); { subvol = __glfs_active_subvol (fs); @@ -968,7 +973,7 @@ glfs_cwd_set (struct glfs *fs, inode_t *inode) { int ret = 0; - glfs_lock (fs); + glfs_lock (fs, _gf_true); { ret = __glfs_cwd_set (fs, inode); } @@ -1001,7 +1006,7 @@ glfs_cwd_get (struct glfs *fs) { inode_t *cwd = NULL; - glfs_lock (fs); + glfs_lock (fs, _gf_true); { cwd = __glfs_cwd_get (fs); } @@ -1041,7 +1046,7 @@ glfs_resolve_inode (struct glfs *fs, xlator_t *subvol, { inode_t *inode = NULL; - glfs_lock (fs); + glfs_lock (fs, _gf_true); { inode = __glfs_resolve_inode(fs, subvol, object); } |