Messages in this thread Patch in this message | | | Date | Wed, 7 Jul 2004 15:47:33 +0300 | From | Oleg Drokin <> | Subject | [9/9] Lustre VFS patches for 2.6 |
| |
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); - 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/
| |