From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754701AbbAFJ7s (ORCPT ); Tue, 6 Jan 2015 04:59:48 -0500 Received: from casper.infradead.org ([85.118.1.10]:53103 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753951AbbAFJ7q (ORCPT ); Tue, 6 Jan 2015 04:59:46 -0500 Date: Tue, 6 Jan 2015 10:59:30 +0100 From: Peter Zijlstra To: Sedat Dilek Cc: Dave Jones , Linus Torvalds , LKML , Takashi Iwai Subject: Re: Linux 3.19-rc3 Message-ID: <20150106095930.GK29390@twins.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 06, 2015 at 10:34:30AM +0100, Sedat Dilek wrote: > I tried to do such a "similiar" (quick) fix analog to the mentioned > "sched, inotify: Deal with nested sleeps" patch from Peter. > If I did correct... It does not make the call-trace go away here. Are you very sure its the same splat and not another? I don't appear to have anything triggering this on my test boxes (which are very much not infected with system-disease). The patch does look about right. > --- > fs/notify/fanotify/fanotify_user.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > index c991616..65e96e2 100644 > --- a/fs/notify/fanotify/fanotify_user.c > +++ b/fs/notify/fanotify/fanotify_user.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > > #include > > @@ -259,15 +260,15 @@ static ssize_t fanotify_read(struct file *file, char __user *buf, > struct fsnotify_event *kevent; > char __user *start; > int ret; > - DEFINE_WAIT(wait); > + DEFINE_WAIT_FUNC(wait, woken_wake_function); > > start = buf; > group = file->private_data; > > pr_debug("%s: group=%p\n", __func__, group); > > + add_wait_queue(&group->notification_waitq, &wait); > while (1) { > - prepare_to_wait(&group->notification_waitq, &wait, TASK_INTERRUPTIBLE); > > mutex_lock(&group->notification_mutex); > kevent = get_one_event(group, count); > @@ -289,7 +290,7 @@ static ssize_t fanotify_read(struct file *file, char __user *buf, > > if (start != buf) > break; > - schedule(); > + wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); > continue; > } > > @@ -318,8 +319,8 @@ static ssize_t fanotify_read(struct file *file, char __user *buf, > buf += ret; > count -= ret; > } > + remove_wait_queue(&group->notification_waitq, &wait); > > - finish_wait(&group->notification_waitq, &wait); > if (start != buf && ret != -EFAULT) > ret = buf - start; > return ret; > -- > 2.2.1 >