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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED 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 8197FC43381 for ; Wed, 13 Mar 2019 16:37:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 473F22171F for ; Wed, 13 Mar 2019 16:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552495057; bh=qKkJ5k3F9rXH97HOLBnomOe0QP4stuAagFyWgcCVoYw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=ceeTeXpvVS87CGUOY+3UE0dk+wQ+gTKEl54LpGuDc+6wnzMcxvm1NeijDtjlT1hwP l5G6U470lkomeV6Uu2uy5IuOG9q7iBTs6rPIZSVJ520+e9LtubXerEmALnJWUV3Mlm 57bpDEn9HbK/FfTSypgNQ5O7Rjitl2pq/iI6Hsuo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbfCMQhg (ORCPT ); Wed, 13 Mar 2019 12:37:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42410 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfCMQhg (ORCPT ); Wed, 13 Mar 2019 12:37:36 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 67A7ECBA; Wed, 13 Mar 2019 16:37:35 +0000 (UTC) Date: Wed, 13 Mar 2019 09:37:34 -0700 From: Andrew Morton To: "Darrick J. Wong" 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: <20190313093734.b924a6a8f07afd277ab96e14@linux-foundation.org> In-Reply-To: <20190312214910.GK20533@magnolia> References: <20190312214910.GK20533@magnolia> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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? 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? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Date: Wed, 13 Mar 2019 09:37:34 -0700 Subject: [Ocfs2-devel] [PATCH] ocfs2: fix inode bh swapping mixup in ocfs2_reflink_inodes_lock In-Reply-To: <20190312214910.GK20533@magnolia> References: <20190312214910.GK20533@magnolia> Message-ID: <20190313093734.b924a6a8f07afd277ab96e14@linux-foundation.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Darrick J. Wong" Cc: ocfs2-devel@oss.oracle.com, mark@fasheh.com, jlbec@evilplan.org, linux-fsdevel@vger.kernel.org, Junxiao Bi , Joseph Qi , Mark Fasheh 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? Folks, could we please get prompt review of this one? > mark at fasheh.com hm, I have mfasheh at versity.com but MAINTAINERS says mark at fasheh.com. Mark, can you please clarify?