From: Li Zhong Date: Wed, 13 Nov 2013 07:21:51 +0000 (+0800) Subject: fix unpaired rcu lock in prepend_path() X-Git-Tag: MMI-PSA29.97-13-9~13296^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4ec6c2aeab8a909418ac60b782a963cb7257207f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git fix unpaired rcu lock in prepend_path() Signed-off-by: Li Zhong Signed-off-by: Al Viro --- diff --git a/fs/dcache.c b/fs/dcache.c index 1f24cd684c51..eacc853a2e3a 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;