Commit 4ec6c2ae authored by Li Zhong's avatar Li Zhong Committed by Al Viro

fix unpaired rcu lock in prepend_path()

Signed-off-by: default avatarLi Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 4fdb793f
...@@ -2924,6 +2924,7 @@ static int prepend_path(const struct path *path, ...@@ -2924,6 +2924,7 @@ static int prepend_path(const struct path *path,
restart_mnt: restart_mnt:
read_seqbegin_or_lock(&mount_lock, &m_seq); read_seqbegin_or_lock(&mount_lock, &m_seq);
seq = 0; seq = 0;
rcu_read_lock();
restart: restart:
bptr = *buffer; bptr = *buffer;
blen = *buflen; blen = *buflen;
...@@ -2971,6 +2972,9 @@ static int prepend_path(const struct path *path, ...@@ -2971,6 +2972,9 @@ static int prepend_path(const struct path *path,
goto restart; goto restart;
} }
done_seqretry(&rename_lock, seq); done_seqretry(&rename_lock, seq);
if (!(m_seq & 1))
rcu_read_unlock();
if (need_seqretry(&mount_lock, m_seq)) { if (need_seqretry(&mount_lock, m_seq)) {
m_seq = 1; m_seq = 1;
goto restart_mnt; goto restart_mnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment