Re: [PATCH] hfsplus: add journal replay

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Am 23.02.2014 um 07:03 schrieb Hin-Tak Leung <htl10@xxxxxxxxxxxxxxxxxxxxx>:
> 
> ------------------------------
> On Sun, Feb 23, 2014 5:33 AM GMT Sergei Antonov wrote:
> 
>>> --- a/fs/hfsplus/hfsplus_fs.h
>>> +++ b/fs/hfsplus/hfsplus_fs.h
>>> ...
>>> @@ -166,6 +167,11 @@ struct hfsplus_sb_info {
>>>     u32 total_blocks;
>>>     u32 data_clump_blocks, rsrc_clump_blocks;
>>> 
>>> +    /* immutable data on the placement of the journal (if there is one) */
>>> +    u64 journal_offset;    /* relative to volume start */
>>> +    u64 journal_size;    /* relative to volume start */
>>> +    bool journal_swab;    /* need swap bytes in journal */
>>> +
>>>     /* mutable data from the volume header, protected by alloc_mutex */
>>>     u32 free_blocks;
>>>     struct mutex alloc_mutex;
>>> ...
>>> 
>>> --- a/fs/hfsplus/hfsplus_raw.h
>>> +++ b/fs/hfsplus/hfsplus_raw.h
>>> @@ -105,7 +105,7 @@ struct hfsplus_vh {
>>>     __be16 version;
>>>     __be32 attributes;
>>>     __be32 last_mount_vers;
>>> -    u32 reserved;
>>> +    __be32 jrnl_info_block;
>>> 
>>>     __be32 create_date;
>>>     __be32 modify_date;
>>> @@ -145,6 +145,69 @@ struct hfsplus_vh {
>>> #define HFSPLUS_VOL_JOURNALED        (1 < 13)
>>> #define HFSPLUS_VOL_SOFTLOCK        (1 < 15)
>>> 
>>> +/* Journal info */
>>> +struct hfs_jrnl_info {
>>> +    __be32 flags;
>>> +    u32 unused[8];
>>> +    __be64 journal_offset;    /* Misaligned! relative to volume start */
>>> +    __be64 journal_size;    /* Misaligned! relative to volume start */
>>> +} __packed;
>>> +
>>> ...
>>> 
>>> Storing  journal_offset and journal_size in two places seems redundant
>>> - the journal info block is part of the volume header struct, which is accessible
>>> from the superblock struct.
>> 
>> It is not in volume header. Only its block number is in header.
> 
> Hmm, would be make sense to hook them up? seems a bit strange
> to have a smaller loose-hanging struct which is 2/3 of the superblock addition.

The structure has misaligned fields. It is only good for reading values through special misalignment-safe functions once. Temporal structure on a way to journal.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux