From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98563C43381 for ; Wed, 13 Mar 2019 16:48:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D1BB206DF for ; Wed, 13 Mar 2019 16:48:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="2sJNrIti" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726187AbfCMQsL (ORCPT ); Wed, 13 Mar 2019 12:48:11 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:58764 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbfCMQsL (ORCPT ); Wed, 13 Mar 2019 12:48:11 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2DGXRx6082112; Wed, 13 Mar 2019 16:47:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=3yGEF07aNgYMmI4Ir2GRg2uq1tYfpfvOAQvNl5xmbLI=; b=2sJNrItiPPaJ7iNCQn10mof3r0vS8H0BQ2XEkyKpcvXNP2QawRQo+j6OZ0fpbBSMRWSG I7+NjtyuuqhyrIf5y85y7rRpKdv8ws3IZ9OSGPlfNR8LvljxyFhvXduIKymsCtviL1HY CJCC8NakcEol1bdrrjFw4MhfMyNfK0OleeG/bMnjZJZPe7MzdYe6ik7PD8Brh56huaKg nAzLvKKISJ0HGPhMykWuITf2SJfoncj7DeSQ8qCxtlbkrSxYIbHiAimb7txI5Et78ttf nNUvoMM4dF3sSZ51ifF+YyCIsBTUM2ag/B+WO6QvO8Iqi/r1mJDDgrlULRgBdF2dOdF7 Uw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2r44wuc8b0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Mar 2019 16:47:55 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2DGlsO0009215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Mar 2019 16:47:54 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2DGlrCf003345; Wed, 13 Mar 2019 16:47:53 GMT Received: from localhost (/10.159.153.61) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 13 Mar 2019 09:47:52 -0700 Date: Wed, 13 Mar 2019 09:47:40 -0700 From: "Darrick J. Wong" To: Andrew Morton Cc: ocfs2-devel@oss.oracle.com, mark@fasheh.com, jlbec@evilplan.org, linux-fsdevel@vger.kernel.org, Junxiao Bi , Joseph Qi , Mark Fasheh Subject: Re: [PATCH] ocfs2: fix inode bh swapping mixup in ocfs2_reflink_inodes_lock Message-ID: <20190313164740.GB4657@magnolia> References: <20190312214910.GK20533@magnolia> <20190313093734.b924a6a8f07afd277ab96e14@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313093734.b924a6a8f07afd277ab96e14@linux-foundation.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9194 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903130116 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Mar 13, 2019 at 09:37:34AM -0700, Andrew Morton wrote: > On Tue, 12 Mar 2019 14:49:10 -0700 "Darrick J. Wong" wrote: > > > From: Darrick J. Wong > > > > ocfs2_reflink_inodes_lock can swap the inode1/inode2 variables so that > > we always grab cluster locks in order of increasing inode number. > > Unfortunately, we forget to swap the inode record buffer head pointers > > when we've done this, which leads to incorrect bookkeepping when we're > > trying to make the two inodes have the same refcount tree. > > > > This has the effect of causing filesystem shutdowns if you're trying to > > reflink data from inode 100 into inode 97, where inode 100 already has a > > refcount tree attached and inode 97 doesn't. The reflink code decides > > to copy the refcount tree pointer from 100 to 97, but uses inode 97's > > inode record to open the tree root (which it doesn't have) and blows up. > > This issue causes filesystem shutdowns and metadata corruption! > > Sounds serious. > > > Fixes: 29ac8e856cb369 ("ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features")] > > November 2016. Should we be adding cc:stable? Yeah. I sent along an RFC version of the testcase (generic/94[134]) that hit this bug now that I've been able to get an overnight testing run completed with the new tests on the other filesystems. --D > Folks, could we please get prompt review of this one? > > > mark@fasheh.com > > hm, I have mfasheh@versity.com but MAINTAINERS says mark@fasheh.com. > Mark, can you please clarify?