From patchwork Wed May 13 16:10:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Vagin X-Patchwork-Id: 6398431 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9D604BEEE1 for ; Wed, 13 May 2015 16:10:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B940B20219 for ; Wed, 13 May 2015 16:10:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75C4820450 for ; Wed, 13 May 2015 16:10:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912AbbEMQKX (ORCPT ); Wed, 13 May 2015 12:10:23 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:12550 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbbEMQKW (ORCPT ); Wed, 13 May 2015 12:10:22 -0400 Received: from localhost.sw.ru ([10.30.24.12]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id t4DGADDp003806; Wed, 13 May 2015 19:10:13 +0300 (MSK) From: Andrey Vagin To: linux-fsdevel@vger.kernel.org Cc: Andrey Vagin , NeilBrown Subject: [PATCH linux-next] fs: don't call _cond_resched() from the rcu critical section Date: Wed, 13 May 2015 19:10:01 +0300 Message-Id: <1431533401-28810-1-git-send-email-avagin@openvz.org> X-Mailer: git-send-email 2.1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The context can't be switched in rcu critical sections. Cc: NeilBrown Cci: Al Viro Fixes: 26c59f88c223 ("VFS/namei: make the use of touch_atime() in get_link() RCU-safe.") Signed-off-by: Andrey Vagin --- fs/namei.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index f884ddd..0ef3c79 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -967,14 +967,13 @@ const char *get_link(struct nameidata *nd) if (!(nd->flags & LOOKUP_RCU)) { touch_atime(&last->link); + _cond_resched(); } else if (atime_needs_update(&last->link, inode)) { if (unlikely(unlazy_walk(nd, NULL, 0))) return ERR_PTR(-ECHILD); touch_atime(&last->link); } - _cond_resched(); - error = security_inode_follow_link(dentry, inode, nd->flags & LOOKUP_RCU); if (unlikely(error))