Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp604296pxb; Wed, 27 Jan 2021 16:29:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkf5Bofpt8bJI2NwBCtDVjz1IKPRbJREF5xK98KPev4G2V8u+IWjvw2Zx6y59Ppi0XSgyb X-Received: by 2002:aa7:d803:: with SMTP id v3mr11098975edq.153.1611793758950; Wed, 27 Jan 2021 16:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611793758; cv=none; d=google.com; s=arc-20160816; b=xbUYlqVc8VHw0do92UXgNoNnXmgqi4WdNzIKw/Fywfrb0v7kDMwilCJfOb9DQSxkJ7 3C7pXoeusc4iND36R+8vNmnVYkH3AjULtfrY+Y+6QzKBy3bW4uq95ThxhS9l+v4g9B29 LHg09udSwdhjwjQ84DfPuWR3AQdPlh5HaVtW+xm6QrNdBUglxxj5I/eLuH3g9OHJo24e dw3fmdg5yi6iCQJ3c+skeT/nppihMSguAHsMF3cqzwFZ28cFHu2sNmjjrqRqGlxsAf1y OCQiXyYsO0RKswzAUTj3eDDeZsKT6UcVpNhN2+Co5nYfkSd0RaN/yzKHzcknKl7Fjtal vtyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=nnacEeyHiRLRZKknnAZ1+IiExrUVDrKlWw94kVyK53A=; b=dcXQhGIODl76Kts/QcwGYt8HWsJVAFnY1TFv/O0dqASMIfEc4i0iXdSN63pENqf0NF jzvmcpUCoJte8iXF1iY4zoZsng1f2EAtOS0h4PBVNTONqK40gxa+skWHd8XxdX1lB5MU D/f7J9zWEdwhVlrYN+ZMghmdpZ+XXDsXxgOqEvTm2Wt+CMAONQhYkyh+SMGqzb1rklfK 1iDw4OPrfKsDyCWgQXvQpLC0x5VcNv5t2LQA8pe3yKEBjpy/+iWYKrkRKmNY/7+qOnWa Hjq8ByP/+k5/f7yfq+2jCExXMaoqjOq2g8YEWZTP371f2s7sPDuZGpsOYa6OHwANg6Mq 7dMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i22si1509130ejb.513.2021.01.27.16.28.55; Wed, 27 Jan 2021 16:29:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233372AbhA0Ur0 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 27 Jan 2021 15:47:26 -0500 Received: from lithops.sigma-star.at ([195.201.40.130]:41476 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233256AbhA0UrY (ORCPT ); Wed, 27 Jan 2021 15:47:24 -0500 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 78CDF61D8A8E; Wed, 27 Jan 2021 21:46:42 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vdBZFFYqQkLv; Wed, 27 Jan 2021 21:46:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id A4ED961D8A97; Wed, 27 Jan 2021 21:46:40 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id p5INWvL6CD1R; Wed, 27 Jan 2021 21:46:40 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 79A2E61D8A8E; Wed, 27 Jan 2021 21:46:40 +0100 (CET) Date: Wed, 27 Jan 2021 21:46:40 +0100 (CET) From: Richard Weinberger To: Tomas Winkler Cc: Miquel Raynal , Vignesh Raghavendra , linux-mtd , linux-kernel Message-ID: <9732911.325628.1611780400338.JavaMail.zimbra@nod.at> In-Reply-To: <20210127200319.662842-1-tomas.winkler@intel.com> References: <20210127200319.662842-1-tomas.winkler@intel.com> Subject: Re: [PATCH] mtd: use refcount to prevent corruption MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF78 (Linux)/8.8.12_GA_3809) Thread-Topic: use refcount to prevent corruption Thread-Index: r0YCwcJ7fDRcCCdg7evH/Zy4+yWw0g== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tomas, ----- Ursprüngliche Mail ----- > Von: "Tomas Winkler" > An: "Miquel Raynal" , "richard" , "Vignesh Raghavendra" , > "linux-mtd" , "linux-kernel" > CC: "Tomas Winkler" > Gesendet: Mittwoch, 27. Januar 2021 21:03:19 > Betreff: [PATCH] mtd: use refcount to prevent corruption > When underlying device is removed mtd core will crash > in case user space is still holding an open handle to a mtd device node. > A proper refcounting is needed so device is release only when a > partition has no active users. The current simple counter is not > sufficient. Can you please explain a little more what devices are involved? Does it implement _get_device() and _put_device()? Thanks, //richard