提交 383c5535 编写于 作者: S Steve French

[CIFS] Fix endian error comparing authusers when cifsacl enabled

Fix sparse warning:
 CHECK   fs/cifs/cifsacl.c
fs/cifs/cifsacl.c:41:36: warning: incorrect type in initializer
(different base types)
fs/cifs/cifsacl.c:41:36:    expected restricted __le32
fs/cifs/cifsacl.c:41:36:    got int
fs/cifs/cifsacl.c:461:52: warning: restricted __le32 degrades to integer
fs/cifs/cifsacl.c:461:73: warning: restricted __le32 degrades to integer

The second one looks harmless but the first one (sid_authusers)
was added in commit 2fbc2f17
and only affects 2.6.38/2.6.39

CC: Stable <stable@kernel.org>
Reviewed-and-Tested-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 96daf2b0
...@@ -38,7 +38,7 @@ static const struct cifs_sid sid_everyone = { ...@@ -38,7 +38,7 @@ static const struct cifs_sid sid_everyone = {
1, 1, {0, 0, 0, 0, 0, 1}, {0} }; 1, 1, {0, 0, 0, 0, 0, 1}, {0} };
/* security id for Authenticated Users system group */ /* security id for Authenticated Users system group */
static const struct cifs_sid sid_authusers = { static const struct cifs_sid sid_authusers = {
1, 1, {0, 0, 0, 0, 0, 5}, {11} }; 1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(11)} };
/* group users */ /* group users */
static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} }; static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
...@@ -458,7 +458,8 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid) ...@@ -458,7 +458,8 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid)
if (num_subauth) { if (num_subauth) {
for (i = 0; i < num_subauth; ++i) { for (i = 0; i < num_subauth; ++i) {
if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) { if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) {
if (ctsid->sub_auth[i] > cwsid->sub_auth[i]) if (le32_to_cpu(ctsid->sub_auth[i]) >
le32_to_cpu(cwsid->sub_auth[i]))
return 1; return 1;
else else
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册