* [PATCH 0/2] hfsplus fixes for Linux 3.5
@ 2012-06-17 21:05 Christoph Hellwig
2012-06-17 21:05 ` [PATCH 1/2] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christoph Hellwig @ 2012-06-17 21:05 UTC (permalink / raw)
To: torvalds; +Cc: linux-fsdevel, linux-kernel
Two small hfsplus fixes:
- a one liner regression fix for large volume handling from
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio
2012-06-17 21:05 [PATCH 0/2] hfsplus fixes for Linux 3.5 Christoph Hellwig
@ 2012-06-17 21:05 ` Christoph Hellwig
2012-06-17 21:05 ` [PATCH 2/2] hfsplus: fix bless ioctl when used with hardlinks Christoph Hellwig
2012-06-17 21:09 ` [PATCH 0/2] hfsplus fixes for Linux 3.5 Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2012-06-17 21:05 UTC (permalink / raw)
To: torvalds; +Cc: linux-fsdevel, linux-kernel, Janne Kalliom??ki
[-- Attachment #1: hfsplus-mount-fix.diff --]
[-- Type: text/plain, Size: 779 bytes --]
The variable io_size was unsigned int, which caused the wrong sector number
to be calculated after aligning it. This then caused mount to fail with big
volumes, as backup volume header information was searched from a
wrong sector.
Signed-off-by: Janne Kalliom??ki <janne@tuxera.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/hfsplus/wrapper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index 5d2aa0c..1cc3920 100644
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -70,7 +70,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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] hfsplus: fix bless ioctl when used with hardlinks
2012-06-17 21:05 [PATCH 0/2] hfsplus fixes for Linux 3.5 Christoph Hellwig
2012-06-17 21:05 ` [PATCH 1/2] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio Christoph Hellwig
@ 2012-06-17 21:05 ` Christoph Hellwig
2012-06-17 21:09 ` [PATCH 0/2] hfsplus fixes for Linux 3.5 Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2012-06-17 21:05 UTC (permalink / raw)
To: torvalds; +Cc: linux-fsdevel, linux-kernel, Matthew Garrett
[-- Attachment #1: hfsplus-bless.diff --]
[-- Type: text/plain, Size: 1745 bytes --]
From: Matthew Garrett <mjg@redhat.com>
HFS+ doesn't really implement hard links - instead, hardlinks are indicated
by a magic file type which refers to an indirect node in a hidden
directory. The spec indicates that stat() should return the inode number
of the indirect node, but it turns out that this doesn't satisfy the
firmware when it's looking for a bootloader - it wants the catalog ID of
the hardlink file instead. Fix up this case.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/hfsplus/ioctl.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 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] =
--
1.7.10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] hfsplus fixes for Linux 3.5
2012-06-17 21:05 [PATCH 0/2] hfsplus fixes for Linux 3.5 Christoph Hellwig
2012-06-17 21:05 ` [PATCH 1/2] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio Christoph Hellwig
2012-06-17 21:05 ` [PATCH 2/2] hfsplus: fix bless ioctl when used with hardlinks Christoph Hellwig
@ 2012-06-17 21:09 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2012-06-17 21:09 UTC (permalink / raw)
To: torvalds; +Cc: linux-fsdevel, linux-kernel
On Sun, Jun 17, 2012 at 05:05:23PM -0400, Christoph Hellwig wrote:
> Two small hfsplus fixes:
>
> - a one liner regression fix for large volume handling from
Sorry, chopped off the message, should be:
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-17 21:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-17 21:05 [PATCH 0/2] hfsplus fixes for Linux 3.5 Christoph Hellwig
2012-06-17 21:05 ` [PATCH 1/2] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio Christoph Hellwig
2012-06-17 21:05 ` [PATCH 2/2] hfsplus: fix bless ioctl when used with hardlinks Christoph Hellwig
2012-06-17 21:09 ` [PATCH 0/2] hfsplus fixes for Linux 3.5 Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).