Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp679624img; Mon, 18 Mar 2019 11:47:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGNnGV+PjH6WwPVPTiGw2GFpkrHWh+2s6LHQKQhpDXjzWQqS3ZClmqpaAki1FBQFwDPB5Z X-Received: by 2002:a63:e801:: with SMTP id s1mr19115215pgh.378.1552934831545; Mon, 18 Mar 2019 11:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552934831; cv=none; d=google.com; s=arc-20160816; b=qMG75ih83og6JmGsEnFTQs3bs7Tc2oi5cnbv9VaaTp6mHFm9+aBpM8bODuxe4Jsd/a 4ZJ9w2PF+hyCd5WBgqmVCQ9RliUmK8EMCxj3CFC8YfziM7s3a3m/rYQhZ6v0Ob/qQ9RQ OXHYKsjgQp3PFmt+RfYvZ2RbZkxXQQjCqjdZUvDgiljJobA6Kzm0TgHvQjLeG82zeQvI zPF0yOWCCa+sx++PThhgoF1LOoohJ7zL5eUIaCLLkXV3J5t/vxv9fWY1Xabq91dBELn6 pOB1qb9GvGAT/tg+abxozTeku+tN43QehUyY5SdmzPtJn32sEnnseMdorVVrfV7OmMBd +hsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=z+S5uE4Ggfc/pgwsGBWWRz5MX//kpArm0tR0nbrFAxw=; b=fydamzIrWZYTQOPKQFnRanNctoFA28WEYLuruzgl3lTh1xdls7xXiK06J9ip1UmD8J s9nK5nT6Hg2CfID0aAEGIFha8fqabgbee8pEbfVNgpLUcfuAr7ddQIu4OJCdL7uN5J7f 89+BvbET6qjVlMTK5izZUTAMuDdAlXeJoav4ePSE5ZWGs4GMcat0Ic7uC5gFpkx72UJz 4RbvkFMjs+ithkgYqL917i2GiRwIWgJs9Cf/yMj7Q4lFXMeW/GUC7d6RPxxpeSBja1Ts fAIdp6r3z5DrXm9gkiWYZEtc11+T5p7J1BytRkneMDZq/lztZSIJrNOas11BazF2hcCG c0HQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si9069168pgs.268.2019.03.18.11.46.55; Mon, 18 Mar 2019 11:47:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbfCRSqH (ORCPT + 99 others); Mon, 18 Mar 2019 14:46:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:50904 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726839AbfCRSqH (ORCPT ); Mon, 18 Mar 2019 14:46:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id AEB38AF0C; Mon, 18 Mar 2019 18:46:05 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 29C1DDA829; Mon, 18 Mar 2019 19:47:21 +0100 (CET) Date: Mon, 18 Mar 2019 19:47:20 +0100 From: David Sterba To: Andrea Righi Cc: Chris Mason , Josef Bacik , David Sterba , Johannes Thumshirn , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] btrfs: raid56: properly unmap parity page in finish_parity_scrub() Message-ID: <20190318184720.GF3516@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Andrea Righi , Chris Mason , Josef Bacik , David Sterba , Johannes Thumshirn , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190313101703.GA9155@xps-13> <20190314075628.GA11282@xps-13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190314075628.GA11282@xps-13> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 14, 2019 at 08:56:28AM +0100, Andrea Righi wrote: > Parity page is incorrectly unmapped in finish_parity_scrub(), triggering > a reference counter bug on i386, i.e.: > > [ 157.662401] kernel BUG at mm/highmem.c:349! > [ 157.666725] invalid opcode: 0000 [#1] SMP PTI > > The reason is that kunmap(p_page) was completely left out, so we never > did an unmap for the p_page and the loop unmapping the rbio page was > iterating over the wrong number of stripes: unmapping should be done > with nr_data instead of rbio->real_stripes. > > Test case to reproduce the bug: > > - create a raid5 btrfs filesystem: > # mkfs.btrfs -m raid5 -d raid5 /dev/sdb /dev/sdc /dev/sdd /dev/sde > > - mount it: > # mount /dev/sdb /mnt > > - run btrfs scrub in a loop: > # while :; do btrfs scrub start -BR /mnt; done > > BugLink: https://bugs.launchpad.net/bugs/1812845 > Reviewed-by: Johannes Thumshirn > Signed-off-by: Andrea Righi Reviewed-by: David Sterba Thanks.