This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".
http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=b0fdc2f9d6ce482ba6a7cb54cc9f17a0be1ff395 The branch, RHEL5 has been updated via b0fdc2f9d6ce482ba6a7cb54cc9f17a0be1ff395 (commit) from b2686ffe984c517110b949d604c54a71800b67c9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b0fdc2f9d6ce482ba6a7cb54cc9f17a0be1ff395 Author: Benjamin Marzinski <[EMAIL PROTECTED]> Date: Thu Apr 17 11:41:09 2008 -0500 The gnbd kernel module on 64 bit architectures didn't handle ioctls from 32 bit userspace processes. Now it does. Resolves: bz #440454 Also, I was getting an error because on ppc64, the manual definition of O_DIRECT in gnbd/server/device.c was incorrect. I switched to defining _GNU_SOURCE, which should mean that O_DIRECT will be automatically defined. ----------------------------------------------------------------------- Summary of changes: gnbd-kernel/src/gnbd.c | 33 +++++++++++++++++++++++++++++++++ gnbd/server/device.c | 7 ++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/gnbd-kernel/src/gnbd.c b/gnbd-kernel/src/gnbd.c index 2795961..d637141 100644 --- a/gnbd-kernel/src/gnbd.c +++ b/gnbd-kernel/src/gnbd.c @@ -30,6 +30,9 @@ #include <linux/buffer_head.h> #include <linux/miscdevice.h> #include <linux/moduleparam.h> +#ifdef CONFIG_COMPAT +#include <linux/compat.h> +#endif #include <asm/uaccess.h> #include <asm/types.h> @@ -801,6 +804,33 @@ static int gnbd_ctl_ioctl(struct inode *inode, struct file *file, return -EINVAL; } +#ifdef CONFIG_COMPAT +static long gnbd_ctl_compat_ioctl(struct file *f, unsigned cmd, + unsigned long arg) +{ + int ret; + switch (cmd) { + case GNBD_DISCONNECT: + case GNBD_CLEAR_QUE: + case GNBD_PING: + case GNBD_PRINT_DEBUG: + lock_kernel(); + ret = gnbd_ctl_ioctl(f->f_dentry->d_inode, f, cmd, arg); + unlock_kernel(); + return ret; + case GNBD_DO_IT: + case GNBD_GET_TIME: + lock_kernel(); + ret = gnbd_ctl_ioctl(f->f_dentry->d_inode, f, cmd, + (unsigned long)compat_ptr(arg)); + unlock_kernel(); + return ret; + default: + return -ENOIOCTLCMD; + } +} +#endif + static int gnbd_open(struct inode *inode, struct file *file) { struct gnbd_device *dev = inode->i_bdev->bd_disk->private_data; @@ -836,6 +866,9 @@ static int gnbd_release(struct inode *inode, struct file *file) static struct file_operations _gnbd_ctl_fops = { .ioctl = gnbd_ctl_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = gnbd_ctl_compat_ioctl, +#endif .owner = THIS_MODULE, }; diff --git a/gnbd/server/device.c b/gnbd/server/device.c index 2c830ae..b547897 100644 --- a/gnbd/server/device.c +++ b/gnbd/server/device.c @@ -10,6 +10,7 @@ ******************************************************************************* ******************************************************************************/ +#define _GNU_SOURCE #include <unistd.h> #include <stdlib.h> #include <string.h> @@ -27,10 +28,6 @@ #define BLKGETSIZE64 _IOR(0x12, 114, uint64_t) #endif -#ifndef O_DIRECT -#define O_DIRECT 040000 -#endif - #include "list.h" #include "gnbd_utils.h" #include "local_req.h" @@ -106,7 +103,7 @@ int open_file(char *path, unsigned int flags, int *devfd) if (fd < 0){ err = -errno; log_err("cannot open %s in %s%s mode : %s\n", path, - (flags & GNBD_FLAGS_READONLY)? "O_RDONLY" : "O_RDWR | OSYNC", + (flags & GNBD_FLAGS_READONLY)? "O_RDONLY" : "O_RDWR | O_SYNC", (flags & GNBD_FLAGS_UNCACHED)? " | O_DIRECT" : "", strerror(errno)); return err; hooks/post-receive -- Cluster Project