Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbdCMKz4 convert rfc822-to-8bit (ORCPT ); Mon, 13 Mar 2017 06:55:56 -0400 Received: from mga11.intel.com ([192.55.52.93]:20840 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015AbdCMKzq (ORCPT ); Mon, 13 Mar 2017 06:55:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,158,1486454400"; d="scan'208";a="1107837476" From: "Reshetova, Elena" To: "dsterba@suse.cz" CC: "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , "peterz@infradead.org" , "gregkh@linuxfoundation.org" , "jbacik@fb.com" , "clm@fb.com" , "dsterba@suse.com" Subject: RE: [PATCH 00/17] fs, btrfs refcount conversions Thread-Topic: [PATCH 00/17] fs, btrfs refcount conversions Thread-Index: AQHSk/vxwG0c04VoYUG4efP6jfvZG6GMtSgAgAXzSsA= Date: Mon, 13 Mar 2017 10:54:53 +0000 Message-ID: <2236FBA76BA1254E88B949DDB74E612B41C581FB@IRSMSX102.ger.corp.intel.com> References: <1488531326-21271-1-git-send-email-elena.reshetova@intel.com> <20170309160234.GH14605@twin.jikos.cz> In-Reply-To: <20170309160234.GH14605@twin.jikos.cz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1819 Lines: 35 > On Fri, Mar 03, 2017 at 10:55:09AM +0200, Elena Reshetova wrote: > > Now when new refcount_t type and API are finally merged > > (see include/linux/refcount.h), the following > > patches convert various refcounters in the btrfs filesystem from atomic_t > > to refcount_t. By doing this we prevent intentional or accidental > > underflows or overflows that can led to use-after-free vulnerabilities. > > > > The below patches are fully independent and can be cherry-picked separately. > > Since we convert all kernel subsystems in the same fashion, resulting > > in about 300 patches, we have to group them for sending at least in some > > fashion to be manageable. Please excuse the long cc list. > > Thanks, the patchset looks good to me, I'm going to add it to the 4.12 queue. Thank you very much! > > > These patches have been tested with xfstests by running btrfs-related tests. > > btrfs debug was enabled, warns on refcount errors, too. No output related to > > refcount errors produced. However, the following errors were during the run: > > * tests btrfs/078, btrfs/114, btrfs/115, no errors anywhere in dmesg, but > > process hangs. They all seem to be around qgroup, sometimes error visible > > such as qgroup scan failed -4 before it blocks, but not always. > > * test btrfs/104 dmesg has additional error output: > > BTRFS warning (device vdc): qgroup 258 reserved space underflow, have: 0, > > to free: 4096 > > I tried looking at the code on what causes the failure, but could not figure > > it out. It doesn't seem to be related to any refcount changes at least IMO. > > > > The above test failures are hard for me to understand and interpreted, but > > they don't seem to relate to refcount conversions. > > I don't think they're related to the refcount updates so we'll address > them.