From patchwork Wed Sep 19 07:22:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1476171 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4035CDF238 for ; Wed, 19 Sep 2012 07:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754595Ab2ISHWx (ORCPT ); Wed, 19 Sep 2012 03:22:53 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:37881 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774Ab2ISHWx (ORCPT ); Wed, 19 Sep 2012 03:22:53 -0400 Received: by qaas11 with SMTP id s11so3189453qaa.19 for ; Wed, 19 Sep 2012 00:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=6tcOhzD65X6VR/D47f/dcQNoOzW1bsvnKgV0UDu5kD4=; b=RzS3I56XV9HcH/8dfRFcKMlaV9OuN3TFNTc6WR+74r7viapeYVUd+BjUNMlrTn+cnX W9l6K4Ic19cTB0oDeygbIe6/haB5HoQoM0P1RJqzSWCC54Fz9vtxU0bDSOzUe3Lmu8RN JX70Hy2TEkHfAiBN1JcF5CpRl3v6iRnjyro8o8nYNfDMev55L20UZYITboeSOLBfKWDS ikkRpoziyOWcWbSA9j8M5V4j8U2oVV+Lzd2ggCqiAZZdw+Ts0GxDvLjsax7QlWYKdT8G sBM9fB62Sdrl8Su/z3rECE7pGA13unx4OCNC0vCEJO21EAAsjv83hH6MfFrgkqeqRVmY NdHA== MIME-Version: 1.0 Received: by 10.229.136.69 with SMTP id q5mr1477036qct.85.1348039372522; Wed, 19 Sep 2012 00:22:52 -0700 (PDT) Received: by 10.49.73.170 with HTTP; Wed, 19 Sep 2012 00:22:52 -0700 (PDT) Date: Wed, 19 Sep 2012 02:22:52 -0500 Message-ID: Subject: [PATCH] [CIFS] Trivial Endian Fixes From: Steve French To: linux-cifs@vger.kernel.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Some trivial endian fixes for the SMB2 code. One remains which I asked Pavel to look at. if (!length) { diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index cd31715..7b1c5e3 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -422,7 +422,8 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server) struct cifs_pending_open *open; struct smb2_lease_break_work *lw; bool found; - int ack_req = rsp->Flags & SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED; + int ack_req = le32_to_cpu(rsp->Flags & + SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED); lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL); if (!lw) { @@ -524,7 +525,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) if (rsp->hdr.Command != SMB2_OPLOCK_BREAK) return false; - if (le16_to_cpu(rsp->StructureSize) != + if (rsp->StructureSize != smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) { if (le16_to_cpu(rsp->StructureSize) == 44) return smb2_is_valid_lease_break(buffer, server); diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 630156f..2183bb3 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -496,7 +496,7 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length) { struct smb2_hdr *hdr = (struct smb2_hdr *)buf; - if (le32_to_cpu(hdr->Status) != STATUS_PENDING) + if (hdr->Status != STATUS_PENDING) return false;