diff options
| -rw-r--r-- | fs/hfsplus/dir.c | 2 | ||||
| -rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 3 | ||||
| -rw-r--r-- | fs/hfsplus/inode.c | 2 | ||||
| -rw-r--r-- | fs/hfsplus/ioctl.c | 12 |
4 files changed, 12 insertions, 7 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 5f4023678251..764fd1bdca88 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
| @@ -494,7 +494,7 @@ const struct inode_operations hfsplus_dir_inode_operations = { | |||
| 494 | const struct file_operations hfsplus_dir_operations = { | 494 | const struct file_operations hfsplus_dir_operations = { |
| 495 | .read = generic_read_dir, | 495 | .read = generic_read_dir, |
| 496 | .readdir = hfsplus_readdir, | 496 | .readdir = hfsplus_readdir, |
| 497 | .ioctl = hfsplus_ioctl, | 497 | .unlocked_ioctl = hfsplus_ioctl, |
| 498 | .llseek = generic_file_llseek, | 498 | .llseek = generic_file_llseek, |
| 499 | .release = hfsplus_dir_release, | 499 | .release = hfsplus_dir_release, |
| 500 | }; | 500 | }; |
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 5c10d803d9df..6505c30ad965 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h | |||
| @@ -337,8 +337,7 @@ struct inode *hfsplus_new_inode(struct super_block *, int); | |||
| 337 | void hfsplus_delete_inode(struct inode *); | 337 | void hfsplus_delete_inode(struct inode *); |
| 338 | 338 | ||
| 339 | /* ioctl.c */ | 339 | /* ioctl.c */ |
| 340 | int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 340 | long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
| 341 | unsigned long arg); | ||
| 342 | int hfsplus_setxattr(struct dentry *dentry, const char *name, | 341 | int hfsplus_setxattr(struct dentry *dentry, const char *name, |
| 343 | const void *value, size_t size, int flags); | 342 | const void *value, size_t size, int flags); |
| 344 | ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, | 343 | ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 1bcf597c0562..9bbb82924a22 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
| @@ -285,7 +285,7 @@ static const struct file_operations hfsplus_file_operations = { | |||
| 285 | .fsync = file_fsync, | 285 | .fsync = file_fsync, |
| 286 | .open = hfsplus_file_open, | 286 | .open = hfsplus_file_open, |
| 287 | .release = hfsplus_file_release, | 287 | .release = hfsplus_file_release, |
| 288 | .ioctl = hfsplus_ioctl, | 288 | .unlocked_ioctl = hfsplus_ioctl, |
| 289 | }; | 289 | }; |
| 290 | 290 | ||
| 291 | struct inode *hfsplus_new_inode(struct super_block *sb, int mode) | 291 | struct inode *hfsplus_new_inode(struct super_block *sb, int mode) |
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index f457d2ca51ab..ac405f099026 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c | |||
| @@ -17,14 +17,16 @@ | |||
| 17 | #include <linux/mount.h> | 17 | #include <linux/mount.h> |
| 18 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
| 19 | #include <linux/xattr.h> | 19 | #include <linux/xattr.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
| 21 | #include "hfsplus_fs.h" | 22 | #include "hfsplus_fs.h" |
| 22 | 23 | ||
| 23 | int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 24 | long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
| 24 | unsigned long arg) | ||
| 25 | { | 25 | { |
| 26 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
| 26 | unsigned int flags; | 27 | unsigned int flags; |
| 27 | 28 | ||
| 29 | lock_kernel(); | ||
| 28 | switch (cmd) { | 30 | switch (cmd) { |
| 29 | case HFSPLUS_IOC_EXT2_GETFLAGS: | 31 | case HFSPLUS_IOC_EXT2_GETFLAGS: |
| 30 | flags = 0; | 32 | flags = 0; |
| @@ -38,8 +40,10 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
| 38 | case HFSPLUS_IOC_EXT2_SETFLAGS: { | 40 | case HFSPLUS_IOC_EXT2_SETFLAGS: { |
| 39 | int err = 0; | 41 | int err = 0; |
| 40 | err = mnt_want_write(filp->f_path.mnt); | 42 | err = mnt_want_write(filp->f_path.mnt); |
| 41 | if (err) | 43 | if (err) { |
| 44 | unlock_kernel(); | ||
| 42 | return err; | 45 | return err; |
| 46 | } | ||
| 43 | 47 | ||
| 44 | if (!is_owner_or_cap(inode)) { | 48 | if (!is_owner_or_cap(inode)) { |
| 45 | err = -EACCES; | 49 | err = -EACCES; |
| @@ -85,9 +89,11 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
| 85 | mark_inode_dirty(inode); | 89 | mark_inode_dirty(inode); |
| 86 | setflags_out: | 90 | setflags_out: |
| 87 | mnt_drop_write(filp->f_path.mnt); | 91 | mnt_drop_write(filp->f_path.mnt); |
| 92 | unlock_kernel(); | ||
| 88 | return err; | 93 | return err; |
| 89 | } | 94 | } |
| 90 | default: | 95 | default: |
| 96 | unlock_kernel(); | ||
| 91 | return -ENOTTY; | 97 | return -ENOTTY; |
| 92 | } | 98 | } |
| 93 | } | 99 | } |
