From patchwork Mon Jun 20 15:55:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Peterson X-Patchwork-Id: 9188077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EEDFB601C0 for ; Mon, 20 Jun 2016 16:12:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD92620410 for ; Mon, 20 Jun 2016 16:12:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D22E727A98; Mon, 20 Jun 2016 16:12:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6477C20410 for ; Mon, 20 Jun 2016 16:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932139AbcFTQEM (ORCPT ); Mon, 20 Jun 2016 12:04:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44613 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754371AbcFTQD1 (ORCPT ); Mon, 20 Jun 2016 12:03:27 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CDC7711F6 for ; Mon, 20 Jun 2016 15:55:35 +0000 (UTC) Received: from loki.redhat.com (ovpn-116-103.phx2.redhat.com [10.3.116.103]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5KFtXJ3002710; Mon, 20 Jun 2016 11:55:35 -0400 From: Bob Peterson To: Cc: cluster-devel@redhat.com Subject: [PATCH 3/4] gfs2: Large-filesystem fix for 32-bit systems Date: Mon, 20 Jun 2016 10:55:32 -0500 Message-Id: <1466438133-10564-4-git-send-email-rpeterso@redhat.com> In-Reply-To: <1466438133-10564-1-git-send-email-rpeterso@redhat.com> References: <1466438133-10564-1-git-send-email-rpeterso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 20 Jun 2016 15:55:35 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andreas Gruenbacher Commit ff34245d switched from iget5_locked to iget_locked among other things, but iget_locked doesn't work for filesystems larger than 2^32 blocks on 32-bit systems. Switch back to iget5_locked. Filesystems larger than 2^32 blocks are unrealistic to work well on 32-bit systems, so this is mostly a code cleanliness fix. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/inode.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index ebff26e..481b649 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -37,19 +37,34 @@ #include "super.h" #include "glops.h" +static int iget_test(struct inode *inode, void *opaque) +{ + u64 no_addr = *(u64 *)opaque; + + return GFS2_I(inode)->i_no_addr == no_addr; +} + +static int iget_set(struct inode *inode, void *opaque) +{ + u64 no_addr = *(u64 *)opaque; + + GFS2_I(inode)->i_no_addr = no_addr; + inode->i_ino = no_addr; + return 0; +} + static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr) { struct inode *inode; repeat: - inode = iget_locked(sb, no_addr); + inode = iget5_locked(sb, no_addr, iget_test, iget_set, &no_addr); if (!inode) return inode; if (is_bad_inode(inode)) { iput(inode); goto repeat; } - GFS2_I(inode)->i_no_addr = no_addr; return inode; }