From patchwork Wed Apr 12 03:54:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9676435 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 39CAD60325 for ; Wed, 12 Apr 2017 03:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CF422849A for ; Wed, 12 Apr 2017 03:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FCAA284D8; Wed, 12 Apr 2017 03:54:19 +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 A7E102849A for ; Wed, 12 Apr 2017 03:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752057AbdDLDyQ (ORCPT ); Tue, 11 Apr 2017 23:54:16 -0400 Received: from sandeen.net ([63.231.237.45]:40768 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992AbdDLDyQ (ORCPT ); Tue, 11 Apr 2017 23:54:16 -0400 Received: from [10.0.0.4] (liberator [10.0.0.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id D9B0A58DC1E; Tue, 11 Apr 2017 22:54:15 -0500 (CDT) Subject: [PATCH] xfs_db: set buf flag for inode or dqblk with "type" To: "Darrick J. Wong" , Eric Sandeen References: <20170411225334.GE8502@birch.djwong.org> Cc: xfs From: Eric Sandeen Message-ID: Date: Tue, 11 Apr 2017 22:54:15 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170411225334.GE8502@birch.djwong.org> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, setting "type" to inode or dqblk does not appropriately set the buffer type flags for these types. i.e.: xfs_db> inode 128 sets ino_buf, but xfs_db> convert inode 128 fsblock 0x10 (16) xfs_db> fsblock 16 xfs_db> type inode does not. This is apparent if we try to use "type" to switch to an inode or dqblk, then try to use "write -d" which tests these flags. Signed-off-by: Eric Sandeen --- -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/db/io.c b/db/io.c index 9918a51..d78fc66 100644 --- a/db/io.c +++ b/db/io.c @@ -617,6 +617,13 @@ set_iocur_type( struct xfs_buf *bp = iocur_top->bp; iocur_top->typ = t; + iocur_top->ino_buf = 0; + iocur_top->dquot_buf = 0; + + if (t->typnm == TYP_INODE) + iocur_top->ino_buf = 1; + else if (t->typnm == TYP_DQBLK) + iocur_top->dquot_buf = 1; /* verify the buffer if the type has one. */ if (!bp)