From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F41E2C433E0 for ; Wed, 27 Jan 2021 20:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC1FD64DC4 for ; Wed, 27 Jan 2021 20:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233389AbhA0Ur1 convert rfc822-to-8bit (ORCPT ); Wed, 27 Jan 2021 15:47:27 -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