summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-17 14:40:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-17 14:40:35 -0700
commit39a50b42f7026027b54131291ad0f350100eac95 (patch)
tree609980cbbed5eb6252cbd7e3bec1d42c7051e271
parentfb09185a88cad9c59e22e84f8c0594303595e9af (diff)
parent7dea9665fee828fb56db3bae5b9685d9fa006d33 (diff)
downloadop-kernel-dev-39a50b42f7026027b54131291ad0f350100eac95.zip
op-kernel-dev-39a50b42f7026027b54131291ad0f350100eac95.tar.gz
Merge branch 'hfsplus'
Merge hfsplus fixes from Christoph Hellwig: "Two small hfsplus fixes: - a one liner regression fix for large volume handling from Janne Kalliomäki. - a fixup for the boot image blessing feature to make it work with the fake "hardlinks" in hfsplus from Matthew Garrett." * branch 'hfsplus': hfsplus: fix bless ioctl when used with hardlinks hfsplus: fix overflow in sector calculations in hfsplus_submit_bio
-rw-r--r--fs/hfsplus/ioctl.c9
-rw-r--r--fs/hfsplus/wrapper.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
index c640ba5..09addc8 100644
--- a/fs/hfsplus/ioctl.c
+++ b/fs/hfsplus/ioctl.c
@@ -31,6 +31,7 @@ static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags)
struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
struct hfsplus_vh *vh = sbi->s_vhdr;
struct hfsplus_vh *bvh = sbi->s_backup_vhdr;
+ u32 cnid = (unsigned long)dentry->d_fsdata;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -41,8 +42,12 @@ static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags)
vh->finder_info[0] = bvh->finder_info[0] =
cpu_to_be32(parent_ino(dentry));
- /* Bootloader */
- vh->finder_info[1] = bvh->finder_info[1] = cpu_to_be32(inode->i_ino);
+ /*
+ * Bootloader. Just using the inode here breaks in the case of
+ * hard links - the firmware wants the ID of the hard link file,
+ * but the inode points at the indirect inode
+ */
+ vh->finder_info[1] = bvh->finder_info[1] = cpu_to_be32(cnid);
/* Per spec, the OS X system folder - same as finder_info[0] here */
vh->finder_info[5] = bvh->finder_info[5] =
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index 7daf4b8..90effcc 100644
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -56,7 +56,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
DECLARE_COMPLETION_ONSTACK(wait);
struct bio *bio;
int ret = 0;
- unsigned int io_size;
+ u64 io_size;
loff_t start;
int offset;
OpenPOWER on IntegriCloud