Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3223872ybc; Mon, 25 Nov 2019 10:56:18 -0800 (PST) X-Google-Smtp-Source: APXvYqx87KVORLTQ3/x60cekou0UFAkNztAqUvHtD2tbseBeMO4TJk071eV38DWlxGm040YnDGz7 X-Received: by 2002:a05:6402:158d:: with SMTP id c13mr20408288edv.62.1574708178129; Mon, 25 Nov 2019 10:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574708178; cv=none; d=google.com; s=arc-20160816; b=ZgH6J4dibFO+IvMSGh19+1cdLYvGkUMhZoZbk+vg694LD9zWecbbGfHZeW1m/ajGw5 qJiRmRvVgUwwTAfSBVU7nyHl4EC6WCo9PG+ZYRET67S5CWvAr4hS+/ytSm2bxEtL1Mx8 pNasGl+Hf+ZNy1HCYkLVH9Y7vfEVnsbqSMgQ7pzIR0IB3DgWckN7Ri7/vxN3SK2unvhY g8z4aD9E30Uzlbo/k65ln1xQVuuJRtteQ1U1fBNQojaeffN20+rXkHrptUsCAAtUIzgy G1vM3Th/JxTe+CKoABAEl4Ag7EXHZMNpFcWdfe9s7gMgos8HVZPFWo6i4WJhS2J0xeoM V+Qg== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=iR0/Hucdv3j8LqG791ml5ClhGVd1JTHq07IIeg38yoU=; b=Ks62udN/coM7RBTURiJgcfATjGBGb1vxgTLViq6Lym/dDcOo3Aa56fIZAwOt0CAp71 gyHVVBb2/eZxhn0fZAMvM0nhcNIPFi4G/oVue/7PHNXJT9b6Nffks5hpmdAq7LeEdtBF tLtsUyTUYEjFUGl1RWwXJ+GVD6W9/dHM2tIdo0IfpEKHJH2Cqq0BJx8HjYGeRQd3GJN7 pqcOP7xUgIw4QQw7syHE5+/X84uL/Sz3Qnpah0T21a/RLI6V90sgopCcZk4DytKQuIew tVxgZjujbJd55m7bwAzA5F6nlzfyZB4Y6448HAA+Jw5bBlQlNJ6Et7JgJDq+jfO9PY6F J+gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yAhngtwO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sd11si5207267ejb.368.2019.11.25.10.55.54; Mon, 25 Nov 2019 10:56:18 -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=pass header.i=@kernel.org header.s=default header.b=yAhngtwO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729242AbfKYR7P (ORCPT + 99 others); Mon, 25 Nov 2019 12:59:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:52800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbfKYR7O (ORCPT ); Mon, 25 Nov 2019 12:59:14 -0500 Received: from localhost (unknown [104.132.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1721720679; Mon, 25 Nov 2019 17:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574704754; bh=KeQcj2AKHVhcae5ILgNCmFk/tRvBlisVKhy3DFIZA1c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yAhngtwOvHCL1fYdnEEbD3QRzDnSUoSdtwsxjwj6+a1i1oT56fZJhYAeDWOX9pYoJ xqaYgcyIFhuTi5dVMgwAvRXZ0wF5ScvW9P8jBQhJVFk86A8Oz0PT3jLdQXlMaD6ayz ORtsLGOdmTQelG61JjEYrNOPWeP55O76jyMrx3o4= Date: Mon, 25 Nov 2019 09:59:13 -0800 From: Jaegeuk Kim To: Bart Van Assche Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, stable@vger.kernel.org, Jens Axboe , linux-block@vger.kernel.org Subject: Re: [PATCH v2] loop: avoid EAGAIN, if offset or block_size are changed Message-ID: <20191125175913.GC71634@jaegeuk-macbookpro.roam.corp.google.com> References: <20190518004751.18962-1-jaegeuk@kernel.org> <20190518005304.GA19446@jaegeuk-macbookpro.roam.corp.google.com> <1e1aae74-bd6b-dddb-0c88-660aac33872c@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e1aae74-bd6b-dddb-0c88-660aac33872c@acm.org> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/19, Bart Van Assche wrote: > On 5/17/19 5:53 PM, Jaegeuk Kim wrote: > > This patch tries to avoid EAGAIN due to nrpages!=0 that was originally trying > > to drop stale pages resulting in wrong data access. > > > > Report: https://bugs.chromium.org/p/chromium/issues/detail?id=938958#c38 > > Please provide a more detailed commit description. What is wrong with the > current implementation and why is the new behavior considered the correct > behavior? Some history would be: Original bug fix is: commit 5db470e229e2 ("loop: drop caches if offset or block_size are changed"), which returns EAGAIN so that user land like Chrome would require enhancing their error handling routines. So, this patch tries to avoid EAGAIN while addressing the original bug. > > This patch moves draining code from before the following comment to after > that comment: > > /* I/O need to be drained during transfer transition */ > > Is that comment still correct or should it perhaps be updated? IMHO, it's still valid. > > Thanks, > > Bart.