Commit d84b5b0b authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] large dev_t - second series (10/15)

	Fix for endianness bug in UDF: it writes major and minor as 32bit
host-endian and reads them as 32bit little-endian; obviously a bad idea
on big-endian boxen ;-)  Needed both for 2.4 and 2.6.
parent b418f880
...@@ -1234,9 +1234,10 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) ...@@ -1234,9 +1234,10 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
if (dsea) if (dsea)
{ {
init_special_inode(inode, inode->i_mode, init_special_inode(inode, inode->i_mode, MKDEV(
((le32_to_cpu(dsea->majorDeviceIdent)) << 8) | le32_to_cpu(dsea->majorDeviceIdent),
(le32_to_cpu(dsea->minorDeviceIdent) & 0xFF)); le32_to_cpu(dsea->minorDeviceIdent)
));
/* Developer ID ??? */ /* Developer ID ??? */
udf_release_data(tbh); udf_release_data(tbh);
} }
...@@ -1392,8 +1393,8 @@ udf_update_inode(struct inode *inode, int do_sync) ...@@ -1392,8 +1393,8 @@ udf_update_inode(struct inode *inode, int do_sync)
strcpy(eid->ident, UDF_ID_DEVELOPER); strcpy(eid->ident, UDF_ID_DEVELOPER);
eid->identSuffix[0] = UDF_OS_CLASS_UNIX; eid->identSuffix[0] = UDF_OS_CLASS_UNIX;
eid->identSuffix[1] = UDF_OS_ID_LINUX; eid->identSuffix[1] = UDF_OS_ID_LINUX;
dsea->majorDeviceIdent = inode->i_rdev >> 8; dsea->majorDeviceIdent = cpu_to_le32(imajor(inode));
dsea->minorDeviceIdent = inode->i_rdev & 0xFF; dsea->minorDeviceIdent = cpu_to_le32(iminor(inode));
mark_buffer_dirty_inode(tbh, inode); mark_buffer_dirty_inode(tbh, inode);
udf_release_data(tbh); udf_release_data(tbh);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment