* [9/9] Lustre VFS patches for 2.6
@ 2004-07-07 12:47 Oleg Drokin
0 siblings, 0 replies; only message in thread
From: Oleg Drokin @ 2004-07-07 12:47 UTC (permalink / raw)
To: linux-kernel, braam
Lustre needs to differentiate plain opens from opens for exec, in the latter
case it is possible that client will decide that it cannot execute a file
(after succesful open intent completion) e.g. due to wrong permissions and
that may cause server to leak open file reference as close will never be called.
fs/exec.c | 4 ++--
include/linux/fs.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
--- linus-2.6.7-bk-latest/include/linux/fs.h.orig 2004-07-07 12:33:21.246507224 +0300
+++ linus-2.6.7-bk-latest/include/linux/fs.h 2004-07-07 12:33:55.069365368 +0300
@@ -74,6 +74,7 @@ extern int leases_enable, dir_notify_ena
#define FMODE_READ 1
#define FMODE_WRITE 2
+#define FMODE_EXEC 4
#define RW_MASK 1
#define RWA_MASK 2
--- linus-2.6.7-bk-latest/fs/exec.c.orig 2004-07-07 12:33:05.466906088 +0300
+++ linus-2.6.7-bk-latest/fs/exec.c 2004-07-07 12:33:38.127940856 +0300
@@ -122,7 +122,7 @@ asmlinkage long sys_uselib(const char __
int error;
intent_init(&nd.intent.open, IT_OPEN);
- nd.intent.open.flags = FMODE_READ;
+ nd.intent.open.flags = FMODE_READ|FMODE_EXEC;
error = user_path_walk_it(library, &nd);
if (error)
goto out;
@@ -476,7 +476,7 @@ struct file *open_exec(const char *name)
struct file *file;
intent_init(&nd.intent.open, IT_OPEN);
- nd.intent.open.flags = FMODE_READ;
+ nd.intent.open.flags = FMODE_READ|FMODE_EXEC;
err = path_lookup_it(name, LOOKUP_FOLLOW, &nd);
file = ERR_PTR(err);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-07-07 12:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-07 12:47 [9/9] Lustre VFS patches for 2.6 Oleg Drokin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.