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.8 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 9B9A2C48BE6 for ; Wed, 16 Jun 2021 12:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7631861245 for ; Wed, 16 Jun 2021 12:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232530AbhFPMTJ (ORCPT ); Wed, 16 Jun 2021 08:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232274AbhFPMTJ (ORCPT ); Wed, 16 Jun 2021 08:19:09 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907E2C061574; Wed, 16 Jun 2021 05:17:03 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltUTa-008xcq-AH; Wed, 16 Jun 2021 12:16:58 +0000 Date: Wed, 16 Jun 2021 12:16:58 +0000 From: Al Viro To: Chen Li Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Brauner , Andrew Morton Subject: Re: [PATCH] ramfs: skip mknod if inode already exists. Message-ID: References: <874kdyh65j.wl-chenli@uniontech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874kdyh65j.wl-chenli@uniontech.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Jun 16, 2021 at 10:53:12AM +0800, Chen Li wrote: > > It's possible we try to mknod a dentry, which have > already bound to an inode, just skip it. Caller should have checked may_create(), which includes EEXIST handling. NAKed-by: Al Viro Incidentally, if it ever had been called that way, your variant would leak inode. Not the main problem, though...