[PATCH 10/10] smb: client: mark compression as supported on 64-bit LE only

Enzo Matsumiya <[email protected]>
Newsgroups org.kernel.vger.linux-cifs
Message-ID <[email protected]>
Other architectures require more tuning + tests, even more so to
maintain the same performance.

So for now, mark SMB2 compression as supported only on 64-bit little
endian architectures.

Signed-off-by: Enzo Matsumiya <[email protected]>
---
 fs/smb/client/fs_context.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index abc29500a664..022d12da809c 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -1289,8 +1289,14 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
 			cifs_errorf(fc, "CONFIG_CIFS_COMPRESSION kernel config option is unset\n");
 			goto cifs_parse_mount_err;
 		}
-		ctx->compress = true;
-		cifs_dbg(VFS, "SMB3 compression support is experimental\n");
+
+		/* This is more of a "TODO" than a final statement */
+		if (BITS_PER_LONG < 64 || 0x1234 != cpu_to_le16(0x1234)) {
+			cifs_dbg(VFS, "SMB3 compression is currently only supported on 64-bit little endian architectures, disabling\n");
+		} else {
+			ctx->compress = true;
+			cifs_dbg(VFS, "SMB3 compression support is experimental\n");
+		}
 		break;
 	case Opt_nodfs:
 		ctx->nodfs = 1;
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.