Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5059967imu; Tue, 15 Jan 2019 10:26:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7jYrHmrHBjS/F6k07QWy0sI0Ucopf2NriNtYF32BAICy++4p0KDfBEl0TkT0wAyvdYo56K X-Received: by 2002:a63:4c04:: with SMTP id z4mr5023726pga.312.1547576797059; Tue, 15 Jan 2019 10:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547576797; cv=none; d=google.com; s=arc-20160816; b=C2xOklrjK1LhP9NN4Pcq4u86yeeYBZ+UVJjdH/hZjaTRnNh4VVcNBQNTr79ASCHNq9 A3ABhJc5kkXbX6PnD5QCxLYABlx8D6/XYYZaOBSzOwDgug+CZRvXfCPgGlUPVnEOGI5e M1Z1GeYnVFCklG2gTJlUVsrybNfnAJVEOGbsxxYn7qDw9VCLflA4mVliTrvQAtNR7Hmc zmZZ557JH+wkH1Pg6Uc/n92GJj50tqpOzmmepnq3sN83DucZqEeMXCOQmcTdBTf/afNf v6CPihrKceW2P/n8HWDrPouz1y1zkm8Spl336gCDdrYTeguGnbigZI/5e/GH9iZNdLUi 3kZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MQ9oGYMTQtDjsWmcfp043HGj8iWGVgsL0MfPOslg3/g=; b=C0GjQcLZxByhrFRpJNbKiJGvCiA6PMdvq/v6n6zDgi8LmFnnVCrdugxpZqwmCSf2As WebtcN/COz7d/w87koQPbSxhVWx/cUWwTS555WsIy8gXkYYUqAr6irDzd+FLrvt0pIcn 4U/8sqJukVn/d2/C92iICERlX+gEjiHxbLwIQNi1Ax/8TcFXkhQSlWVkK5rfzyghM8yH 91Ejp/Lj7i7GkE/oNuoNNJWk0cALrN9x0OoGbonVXTNoQNqpC8fTGPMvPqjSTXpIWkV4 ypIk/ODe4hBQpmFM25NQOKrsKrhsNRjrWmH7iCBhUWtVQ3Ox6bndd5POrINSNDS9gGoX 4IEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=YOZwQ7jk; 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 o22si3742220pgb.584.2019.01.15.10.26.16; Tue, 15 Jan 2019 10:26:36 -0800 (PST) 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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=YOZwQ7jk; 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 S1730890AbfAOQDs (ORCPT + 99 others); Tue, 15 Jan 2019 11:03:48 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:53067 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729599AbfAOQDr (ORCPT ); Tue, 15 Jan 2019 11:03:47 -0500 Received: by mail-it1-f194.google.com with SMTP id g76so5823252itg.2 for ; Tue, 15 Jan 2019 08:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MQ9oGYMTQtDjsWmcfp043HGj8iWGVgsL0MfPOslg3/g=; b=YOZwQ7jk9v2/cxp/wzqDkDPFnUN2I4KAzsX6cztbZGaD3kQjTyyM5u1MCNtbVaM0MQ yYjpaLBUSvsJ/FIkvF07pRNZkH7nNllK3uMnNZcVgpcA2GWQbRRF+OAn9s+cubH6vR62 yDnHen2lIMkrw5fnDJ7+QpRAUpfCrjo+Xt7eQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MQ9oGYMTQtDjsWmcfp043HGj8iWGVgsL0MfPOslg3/g=; b=D2Ti1ViK97y44E9bY52K/rNSczxIfBRgShkknnGnWfheiaaIjcW3Ur0t3qrQC7qE+z QmWaBhw7hDTuI6qSivO33EhSVCJ0p9P9/YzD9kzmz7iCYt5cLpHnN7aK5CGxQOvBL28x HB512xjzOuxt4ub2QKxt+hPp+3MUBrq2zPyGnnT1Pw/zO358pMYIRl3GKpO3YE1rMybZ OFqvAUf8Hx1k3r9jKu8Y11MytiQK8wkjD+R9h+i+tgZh5syeSKJ5l4vprenE7qK45Rv6 viuuysYGXywJoQOi5h75E1zlElOgT8s3KqVItNzgbusR8sS+asT9Ci+aoJk0IJP3yrCn PEBA== X-Gm-Message-State: AJcUukfrKDnYu4SCTgscD5sPHDfnORk6t2/qI9B6IW5oGEFL7/PQqtsH YyfwwJE782aX9udHjM+/5npk8Vfr9fxxIKOmcUR5kQ== X-Received: by 2002:a24:710:: with SMTP id f16mr2590092itf.121.1547568226980; Tue, 15 Jan 2019 08:03:46 -0800 (PST) MIME-Version: 1.0 References: <154322517208.18737.3297786654135648324.stgit@localhost.localdomain> <00b1782a-5c5c-5bc8-7ea9-4f8450679fa1@virtuozzo.com> In-Reply-To: From: Miklos Szeredi Date: Tue, 15 Jan 2019 17:03:35 +0100 Message-ID: Subject: Re: [PATCH 1/2] fuse: Fix race in fuse_writepage_in_flight() To: Kirill Tkhai Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 15, 2019 at 4:55 PM Kirill Tkhai wrote: > > On 15.01.2019 18:37, Miklos Szeredi wrote: > > On Thu, Jan 10, 2019 at 12:03 PM Kirill Tkhai wrote: > >> > >> On 10.01.2019 14:00, Miklos Szeredi wrote: > >>> On Thu, Jan 10, 2019 at 11:48 AM Kirill Tkhai wrote: > >>>> > >>>> Hi, Miklos, > >>>> > >>>> any comments about this? > >>> > >>> Is there a reproducer? ISTR that fsx-linux with mmaps enabled was > >>> good for stressing the writeback_cache code. > >> > >> There is no a reproducer, since I found that by eyes during preparation of another patchset. > > > > That's good. It would even better to have a reproducer, but it > > doesn't look easy... > > > > Completely redid this and reordered the patchset so this change is > > made before the locking changes actually introduce the bug. > > Hm, I meant that I found this during preparation of the patchset, > but not that fi->lock patchset introduces the bug. I don't think > the patchset is involved: > > 1)before we had race, because different locks fc->lock and fiq->waitq.lock > are taken in fuse_dev_read() and fuse_writepage_in_flight(); > 2)after we have the same race, and the locks are fi->lock and fiq->waitq.lock. Ah, so the race was introduced earlier, when fiq->waitq.lock was split out from fc->lock. Thanks, Miklos