1
0
Fork 0

fix unpaired rcu lock in prepend_path()

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
hifive-unleashed-5.1
Li Zhong 2013-11-13 15:21:51 +08:00 committed by Al Viro
parent 4fdb793ffe
commit 4ec6c2aeab
1 changed files with 4 additions and 0 deletions

View File

@ -2924,6 +2924,7 @@ static int prepend_path(const struct path *path,
restart_mnt:
read_seqbegin_or_lock(&mount_lock, &m_seq);
seq = 0;
rcu_read_lock();
restart:
bptr = *buffer;
blen = *buflen;
@ -2971,6 +2972,9 @@ restart:
goto restart;
}
done_seqretry(&rename_lock, seq);
if (!(m_seq & 1))
rcu_read_unlock();
if (need_seqretry(&mount_lock, m_seq)) {
m_seq = 1;
goto restart_mnt;