diff options
author | Li Zhong <zhong@linux.vnet.ibm.com> | 2013-11-13 15:21:51 +0800 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-11-13 07:43:10 -0500 |
commit | 4ec6c2aeab8a909418ac60b782a963cb7257207f (patch) | |
tree | 9f9f780852ed4c5a5cce6c2e84cbfceb1c12fd5f /fs | |
parent | 4fdb793ffe262cfc0b796d3b2cd05ca3b687deb9 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dcache.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 1f24cd684c5..eacc853a2e3 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -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; |