Re: [patch 1/3] __leify posix_acl_xattr_entry, posix_acl_xattr_header
diff mbox series

Message ID 200506222246.32763.adobriyan@gmail.com
State New, archived
Headers show
Series
  • Re: [patch 1/3] __leify posix_acl_xattr_entry, posix_acl_xattr_header
Related show

Commit Message

Alexey Dobriyan June 22, 2005, 6:46 p.m. UTC
Christoph, can you comment on what Steve said to my patch which is exactly
the same as yours acl-endianess-annotations.patch?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Christoph Hellwig June 26, 2005, 12:34 p.m. UTC | #1
On Wed, Jun 22, 2005 at 10:46:32PM +0400, Alexey Dobriyan wrote:
> Christoph, can you comment on what Steve said to my patch which is exactly
> the same as yours acl-endianess-annotations.patch?

Sure.

> ============================================================================
> From: Steven French <sfrench@us.ibm.com>
> 
> You may be correct, but making the in memory representations of these
> structions little endian seems wrong and I would be surprised if it were
> little endian, but I have not had time to think through what happens when a
> local filesystem takes an existing hard drive with ACLs on various inodes
> and moves the drive from a little endian to a big endian machine and the
> endian implications on this structure.
> 
> Although the representation on the wire for the cifs protocol is clearly
> little endian for the acl entries, I am uncomfortable with changes to the
> in memory representation until I do more checking.

I have asked myself that question aswell.  The odd thing about our posix
ACL implementation is that the ACL data passed to the xattr syscalls is
_always_ little endian, which is what the structure in this file define.

The incore represenation is in posix_acl.h and is always little endian.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

============================================================================
From: Steven French <sfrench@us.ibm.com>

You may be correct, but making the in memory representations of these
structions little endian seems wrong and I would be surprised if it were
little endian, but I have not had time to think through what happens when a
local filesystem takes an existing hard drive with ACLs on various inodes
and moves the drive from a little endian to a big endian machine and the
endian implications on this structure.

Although the representation on the wire for the cifs protocol is clearly
little endian for the acl entries, I am uncomfortable with changes to the
in memory representation until I do more checking.
============================================================================
--- 25/include/linux/posix_acl_xattr.h~acl-endianess-annotations
+++ 25-akpm/include/linux/posix_acl_xattr.h
@@ -23,13 +23,13 @@ 
 #define ACL_UNDEFINED_ID	(-1)
 
 typedef struct {
-	__u16			e_tag;
-	__u16			e_perm;
-	__u32			e_id;
+	__le16			e_tag;
+	__le16			e_perm;
+	__le32			e_id;
 } posix_acl_xattr_entry;
 
 typedef struct {
-	__u32			a_version;
+	__le32			a_version;
 	posix_acl_xattr_entry	a_entries[0];
 } posix_acl_xattr_header;