linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Vagin <avagin@openvz.org>
To: linux-fsdevel@vger.kernel.org
Cc: Andrey Vagin <avagin@openvz.org>, NeilBrown <neilb@suse.de>
Subject: [PATCH linux-next] fs: don't call _cond_resched() from the rcu critical section
Date: Wed, 13 May 2015 19:10:01 +0300	[thread overview]
Message-ID: <1431533401-28810-1-git-send-email-avagin@openvz.org> (raw)

The context can't be switched in rcu critical sections.

Cc: NeilBrown <neilb@suse.de>
Cci: Al Viro <viro@zeniv.linux.org.uk>
Fixes: 26c59f88c223 ("VFS/namei: make the use of touch_atime() in get_link() RCU-safe.")
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 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))
-- 
2.1.0


             reply	other threads:[~2015-05-13 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 16:10 Andrey Vagin [this message]
2015-05-13 16:12 ` [PATCH linux-next] fs: don't call _cond_resched() from the rcu critical section Andrey Wagin
2015-05-13 20:45 ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431533401-28810-1-git-send-email-avagin@openvz.org \
    --to=avagin@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).