From: Nick Piggin Date: Mon, 12 Feb 2007 08:51:59 +0000 (-0800) Subject: [PATCH] inotify: read return val fix X-Git-Tag: v2.6.21-rc1~274^2~193 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9e4acf3befd3b2903e01b3ef1bd344f03299826;p=pandora-kernel.git [PATCH] inotify: read return val fix Fix for inotify read bug (bugzilla.kernel.org #6999) Problem Description: When reading from an inotify device with an insufficient sized buffer, read(2) will return 0 with no errno set. This is because of an logically incorrect action from the user program thus should return an more logical value. My suggestion is return -EINVAL as for bind(2). This patch is based on the proposal from Ryan , and feedback from John McCutchan . Return -EINVAL if we have not passed in enough buffer space to read a single inotify event, rather than 0 which indicates that there is nothing to read. Signed-off-by: Nick Piggin Acked-by: "John McCutchan" Cc: Ryan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed