Skip to content

Commit

Permalink
fix unpaired rcu lock in prepend_path()
Browse files Browse the repository at this point in the history
Signed-off-by: Li Zhong <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Li Zhong authored and Al Viro committed Nov 13, 2013
1 parent 4fdb793 commit 4ec6c2a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2971,6 +2972,9 @@ static int prepend_path(const struct path *path,
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;
Expand Down

0 comments on commit 4ec6c2a

Please sign in to comment.