From patchwork Wed May 23 03:22:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Rajendra X-Patchwork-Id: 918725 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40rHpF5Dpgz9s1d for ; Wed, 23 May 2018 13:20:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753684AbeEWDUg (ORCPT ); Tue, 22 May 2018 23:20:36 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46116 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753520AbeEWDUg (ORCPT ); Tue, 22 May 2018 23:20:36 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4N3JuLa129752 for ; Tue, 22 May 2018 23:20:35 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2j4uev27vg-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 May 2018 23:20:34 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 May 2018 21:20:34 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 22 May 2018 21:20:31 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4N3KVDH9765278; Tue, 22 May 2018 20:20:31 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ED9F76E035; Tue, 22 May 2018 21:20:30 -0600 (MDT) Received: from localhost.localdomain.com (unknown [9.199.62.68]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id A74666E03A; Tue, 22 May 2018 21:20:29 -0600 (MDT) From: Chandan Rajendra To: linux-ext4@vger.kernel.org Cc: Chandan Rajendra , tytso@mit.edu Subject: [PATCH] e2fsprogs: Use 32-bit variant of ext2fs_swab to read i_projid Date: Wed, 23 May 2018 08:52:07 +0530 X-Mailer: git-send-email 2.9.5 X-TM-AS-GCONF: 00 x-cbid: 18052303-0012-0000-0000-0000164AB458 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009069; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000261; SDB=6.01036299; UDB=6.00530128; IPR=6.00815428; MB=3.00021250; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-23 03:20:32 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052303-0013-0000-0000-000052E4E070 Message-Id: <20180523032207.13773-1-chandan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-23_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805230029 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org i_projid is a 32-bit field of the inode. Hence this commit uses ext2fs_swab32() to convert the i_projid field from the on-disk little endian format to the host cpu format. Without this change, project quota consistency check used to fail on big endian powerpc systems. Signed-off-by: Chandan Rajendra Reviewed-by: Andreas Dilger --- lib/ext2fs/swapfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c index 0cf5f9a..b168a2f 100644 --- a/lib/ext2fs/swapfs.c +++ b/lib/ext2fs/swapfs.c @@ -357,7 +357,7 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t, if (inode_includes(inode_size, i_version_hi)) t->i_version_hi = ext2fs_swab32(f->i_version_hi); if (inode_includes(inode_size, i_projid)) - t->i_projid = ext2fs_swab16(f->i_projid); + t->i_projid = ext2fs_swab32(f->i_projid); /* catch new static fields added after i_projid */ EXT2FS_BUILD_BUG_ON(sizeof(struct ext2_inode_large) != 160);