From: Linus Torvalds Date: Sat, 12 Jan 2008 22:06:34 +0000 (-0800) Subject: Use access mode instead of open flags to determine needed permissions X-Git-Tag: v2.6.24-rc8~39 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=974a9f0b47da74e28f68b9c8645c3786aa5ace1a;p=pandora-kernel.git Use access mode instead of open flags to determine needed permissions Way back when (in commit 834f2a4a1554dc5b2598038b3fe8703defcbe467, aka "VFS: Allow the filesystem to return a full file pointer on open intent" to be exact), Trond changed the open logic to keep track of the original flags to a file open, in order to pass down the the intent of a dentry lookup to the low-level filesystem. However, when doing that reorganization, it changed the meaning of namei_flags, and thus inadvertently changed the test of access mode for directories (and RO filesystem) to use the wrong flag. So fix those test back to use access mode ("acc_mode") rather than the open flag ("flag"). Issue noticed by Bill Roman at Datalight. Reported-and-tested-by: Bill Roman Acked-by: Trond Myklebust Acked-by: Al Viro Cc: Christoph Hellwig Cc: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed