mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
nfsd: Fix a soft lockup race in nfsd_file_mark_find_or_create()
If nfsd_file_mark_find_or_create() keeps winning the race for the nfsd_file_fsnotify_group->mark_mutex against nfsd_file_mark_put() then it can soft lock up, since fsnotify_add_inode_mark() ends up always finding an existing entry. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
b6669305d3
commit
90d2f1da83
1 changed files with 6 additions and 2 deletions
|
@ -132,9 +132,13 @@ nfsd_file_mark_find_or_create(struct nfsd_file *nf)
|
|||
struct nfsd_file_mark,
|
||||
nfm_mark));
|
||||
mutex_unlock(&nfsd_file_fsnotify_group->mark_mutex);
|
||||
fsnotify_put_mark(mark);
|
||||
if (likely(nfm))
|
||||
if (nfm) {
|
||||
fsnotify_put_mark(mark);
|
||||
break;
|
||||
}
|
||||
/* Avoid soft lockup race with nfsd_file_mark_put() */
|
||||
fsnotify_destroy_mark(mark, nfsd_file_fsnotify_group);
|
||||
fsnotify_put_mark(mark);
|
||||
} else
|
||||
mutex_unlock(&nfsd_file_fsnotify_group->mark_mutex);
|
||||
|
||||
|
|
Loading…
Reference in a new issue