From patchwork Fri Aug 28 18:55:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Paris X-Patchwork-Id: 32410 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 5E2DCB7087 for ; Sat, 29 Aug 2009 05:00:15 +1000 (EST) Received: by ozlabs.org (Postfix) id 4B1C4DDD0B; Sat, 29 Aug 2009 05:00:15 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C592FDDD01 for ; Sat, 29 Aug 2009 05:00:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbZH1Szw (ORCPT ); Fri, 28 Aug 2009 14:55:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752141AbZH1Szv (ORCPT ); Fri, 28 Aug 2009 14:55:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25060 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996AbZH1Szu (ORCPT ); Fri, 28 Aug 2009 14:55:50 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7SItiMj027624; Fri, 28 Aug 2009 14:55:44 -0400 Received: from paris.rdu.redhat.com (paris.rdu.redhat.com [10.11.231.241]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7SItgk3028846; Fri, 28 Aug 2009 14:55:43 -0400 From: Eric Paris Subject: [PATCH 1/9] task_struct: add PF_NONOTIFY for fanotify to use To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org Cc: davem@davemloft.net, viro@zeniv.linux.org.uk, alan@linux.intel.com, hch@infradead.org Date: Fri, 28 Aug 2009 14:55:42 -0400 Message-ID: <20090828185542.8014.22791.stgit@paris.rdu.redhat.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since fanotify opens file descriptors inside the kernel for it's listeners it needs a way to make sure that 2 fanotify listeners, both which listen to open events do not continuously see each others open events (and get into a livelock reporting on each other's activity). This fix is to create a new tast_struct flags called PF_NONOTIFY. If this flag is set in a task no fanotify events will be generated for that task. fanotify will set the flag before and open call and will clear it immediately after. Signed-off-by: Eric Paris --- include/linux/sched.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/sched.h b/include/linux/sched.h index b88872f..3c1ce66 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1695,6 +1695,7 @@ extern cputime_t task_gtime(struct task_struct *p); #define PF_EXITING 0x00000004 /* getting shut down */ #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ +#define PF_NONOTIFY 0x00000020 /* In fanotify open operation */ #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ #define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */ #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */