Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934247AbZAOWNW (ORCPT ); Thu, 15 Jan 2009 17:13:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754595AbZAOWCO (ORCPT ); Thu, 15 Jan 2009 17:02:14 -0500 Received: from kroah.org ([198.145.64.141]:38255 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933563AbZAOWCJ (ORCPT ); Thu, 15 Jan 2009 17:02:09 -0500 Date: Thu, 15 Jan 2009 13:59:34 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Michael Kerrisk , Robert Love , Vegard Nossum , Ulrich Drepper , Al Viro Subject: [patch 20/85] inotify: fix type errors in interfaces Message-ID: <20090115215934.GU17227@kroah.com> References: <20090115215237.906089480@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="inotify-fix-type-errors-in-interfaces.patch" In-Reply-To: <20090115215812.GA17227@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2599 Lines: 67 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Michael Kerrisk commit 4ae8978cf92a96257cd8998a49e781be83571d64 upstream. The problems lie in the types used for some inotify interfaces, both at the kernel level and at the glibc level. This mail addresses the kernel problem. I will follow up with some suggestions for glibc changes. For the sys_inotify_rm_watch() interface, the type of the 'wd' argument is currently 'u32', it should be '__s32' . That is Robert's suggestion, and is consistent with the other declarations of watch descriptors in the kernel source, in particular, the inotify_event structure in include/linux/inotify.h: struct inotify_event { __s32 wd; /* watch descriptor */ __u32 mask; /* watch mask */ __u32 cookie; /* cookie to synchronize two events */ __u32 len; /* length (including nulls) of name */ char name[0]; /* stub for possible name */ }; The patch makes the changes needed for inotify_rm_watch(). Signed-off-by: Michael Kerrisk Cc: Robert Love Cc: Vegard Nossum Cc: Ulrich Drepper Signed-off-by: Andrew Morton Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/inotify_user.c | 2 +- include/linux/syscalls.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/fs/inotify_user.c +++ b/fs/inotify_user.c @@ -707,7 +707,7 @@ fput_and_out: return ret; } -asmlinkage long sys_inotify_rm_watch(int fd, u32 wd) +asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd) { struct file *filp; struct inotify_device *dev; --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -550,7 +550,7 @@ asmlinkage long sys_inotify_init(void); asmlinkage long sys_inotify_init1(int flags); asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask); -asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); +asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd); asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/