From: Alain Knaff Date: Tue, 11 Nov 2008 01:08:08 +0000 (-0800) Subject: vfs: lseek(fd, 0, SEEK_CUR) race condition X-Git-Tag: v2.6.29-rc1~506^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b6f1eb97d462a45be3b30759758b5fdbb562c8c;p=pandora-kernel.git vfs: lseek(fd, 0, SEEK_CUR) race condition This patch fixes a race condition in lseek. While it is expected that unpredictable behaviour may result while repositioning the offset of a file descriptor concurrently with reading/writing to the same file descriptor, this should not happen when merely *reading* the file descriptor's offset. Unfortunately, the only portable way in Unix to read a file descriptor's offset is lseek(fd, 0, SEEK_CUR); however executing this concurrently with read/write may mess up the position. [with fixes from akpm] Signed-off-by: Alain Knaff Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- Reading git-diff-tree failed