From patchwork Mon Apr 20 05:33:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xuw2015@gmail.com X-Patchwork-Id: 6239451 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04A1FBF4A6 for ; Mon, 20 Apr 2015 05:33:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FD3A2034C for ; Mon, 20 Apr 2015 05:33:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68D532034B for ; Mon, 20 Apr 2015 05:33:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751066AbbDTFdW (ORCPT ); Mon, 20 Apr 2015 01:33:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39944 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbbDTFdV (ORCPT ); Mon, 20 Apr 2015 01:33:21 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 419DA8EFD9; Mon, 20 Apr 2015 05:33:21 +0000 (UTC) Received: from localhost (dhcp12-175.nay.redhat.com [10.66.12.175] (may be forged)) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3K5XJr3024869; Mon, 20 Apr 2015 01:33:20 -0400 From: xuw2015@gmail.com To: linux-btrfs@vger.kernel.org Cc: George Wang Subject: [PATCH] btrfs-progs: fix btrfs quota rescan failed on PPC64 arch Date: Mon, 20 Apr 2015 13:33:16 +0800 Message-Id: <1429507996-28224-1-git-send-email-xuw2015@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: George Wang PPC64 arch use such following IOC values " \#define _IOC_NONE 1U \#define _IOC_READ 2U \#define _IOC_WRITE 4U " comparing to the default IOC values " \#define _IOC_NONE 0U \#define _IOC_READ 2U \#define _IOC_WRITE 1U" This means the value "_IOW*" will be negative when we store it in the int variables. Such as the "BTRFS_IOC_QGROUP_CREATE", it will be "0x4010942e" on X86_64, but "0x8010942e" on PPC64. Notice that the IOC values are the "unsigned long" type, so we use the "unsigned long" to store it, and this can insure the comparison between the variable and BTRFS_IOC_* valid. Signed-off-by: George Wang Tested-by: Chandan Rajendra --- cmds-quota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-quota.c b/cmds-quota.c index 89cc89c..f6a1cfa 100644 --- a/cmds-quota.c +++ b/cmds-quota.c @@ -109,7 +109,7 @@ static int cmd_quota_rescan(int argc, char **argv) int e; char *path = NULL; struct btrfs_ioctl_quota_rescan_args args; - int ioctlnum = BTRFS_IOC_QUOTA_RESCAN; + unsigned long ioctlnum = BTRFS_IOC_QUOTA_RESCAN; DIR *dirstream = NULL; int wait_for_completion = 0;