Received: by 2002:a25:6ac4:0:0:0:0:0 with SMTP id f187csp5373078ybc; Tue, 24 Mar 2020 15:07:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvINdRoMszoIFXMXJj84j34WqEgEbTl75Y9Rdg2u6Z3iGutPBKDb/MPP52iHh77z/ce++WM X-Received: by 2002:a9d:709a:: with SMTP id l26mr176470otj.159.1585087635519; Tue, 24 Mar 2020 15:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585087635; cv=none; d=google.com; s=arc-20160816; b=VANAlKkg6aoaZXsgdWfiM/oRq3psgI8+7vYylDrrdY99EG9UkmUS0WhmzyMFnqfiOP mzOi+bUSlVHNaZez08pb4ibcoOmn4NjJayso/Ed+8/bS4KwIPqyN+wLQaOGpZvvGWGWK wUwo2rFpUIneubZRLAcZehxNEDfNi+hnEyochxW3ZYM3Ohs9tlHAW11Iyz7wMXYXhqpv FD0NTAkGUJhgpitp3EL3TZYJL9T/s5o/J4N9eyXVRcLv8xgYDM/N6S1TKA+ZqXAR9t3Z You0+I43J476dYt+Jm6fkaTtWMln2uVEy5Hof6ippSCJj36pt7NhxwNixY3m8fOGGD5D lzrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mHGtYFOA5TOZkjN/UEPXMqDa02xE1XnkFIsC2oMkRF0=; b=NNV3YX801lzlyWVmlW1YSWErVZ9b3mpQRPzIgaMoOCY5hYyeheBQfzS+H9NWyXQxDi QT9fHmU10h6irh7fCLkvo5hRn/0ubXGGapdzSWgi2QImfgCIuocC3Iz7UQGlz2iseZ7L hOjdTbWKKm/xKGv6trQgRZNreIR3Fqaeb2QEg/oXWj6tRwXU+LrJ09xAFrkq3ghqBwb1 cyBtQm1pSAQNB71gPX9OKdsZbuewYgMtcbG/1otIrrYKY4AJDX/nMjtC5k2LAZnxj/ow Qe2DR6kpshQAlIOx97yRPbqLsbCVh2fpHcti17Z1rCT71aZz1226EvF+LZAzbhZIxgAz 7nRA== 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 v15si10528865oth.307.2020.03.24.15.06.59; Tue, 24 Mar 2020 15:07:15 -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 S1728241AbgCXWFi (ORCPT + 99 others); Tue, 24 Mar 2020 18:05:38 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:42583 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbgCXWFi (ORCPT ); Tue, 24 Mar 2020 18:05:38 -0400 X-Originating-IP: 91.224.148.103 Received: from localhost.localdomain (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id C461E20004; Tue, 24 Mar 2020 22:05:34 +0000 (UTC) From: Miquel Raynal To: Xiaoming Ni , miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Cc: linux-mtd@lists.infradead.org, zhangweimin12@huawei.com, wangle6@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd:Fix issue where write_cached_data() fails but write() still returns success Date: Tue, 24 Mar 2020 23:05:33 +0100 Message-Id: <20200324220533.15273-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <1584674111-101462-1-git-send-email-nixiaoming@huawei.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: 4e4a9a828af29785fad12ecc11583769e1282024 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-03-20 at 03:15:11 UTC, Xiaoming Ni wrote: > mtdblock_flush() > -->write_cached_data() > --->erase_write() > mtdblock: erase of region [0x40000, 0x20000] on "xxx" failed > > Because mtdblock_flush() always returns 0, > even if write_cached_data() fails and data is not written to the device, > syscall_write() still returns success > > Signed-off-by: Xiaoming Ni Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel