Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1393805pxb; Thu, 28 Oct 2021 02:52:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylwXqIJ8MIDGVyn1EdddRWnFFlXzXpQxmSdtX/TF2JqsqNjrCOtKO9JfI4oZgeuV/3knSV X-Received: by 2002:aa7:db07:: with SMTP id t7mr4879117eds.173.1635414751727; Thu, 28 Oct 2021 02:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635414751; cv=none; d=google.com; s=arc-20160816; b=gdHi5fZhDx151NlYD8p2pI6UqCWZ88QhHs63hgaYvZS4TIVpUf8G//rl8L2jyQY3is ID7s0cRPH3mNrdRrKuDDBAGUBEiahvpwGbz187NnruZuleA332QN8fNBuxLtjHN0pm8v s79hum/b1tnHa8k3nv/FMW6pSQHVZvi29/3hBU1L+4qwvaryrak5mQZLaCe8Bdmok2j7 Xnhp5tN4jZN74qxa3tZg95wOf8d5FGPyiIty04ORuNR7cSJ/oT8+TufAvLac7wwFxTzs Q1aK3d9gb6D+mGt1MGNTU5VlaaFvminTbGyFgm9UfA50IYHOB1brfWCPU20cafKn/6l8 xWYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Fk20SFTna7oenyJFMvCkJ++ZR0TFp2usytKYkzVEf0s=; b=YmNxEaua7RpsOugpG1kBe7u64GT9dXQ5Q9IPanGes1EyIJVSCiE1Ues+lb5hxOkuwm SGORLInK8Rcn3NKJCnWgX7F7aanIFiGCd/6Oiwu0MXyQ/eRpe0JVWXD6J6d9EJ1QSMNQ 6hqPsbFIylqnHAt6isph1DHakgE4niVuZxBvYVJ5j5a9dX5R2A/BPguj6Pncxd1X3IvG zRBI2MrG702aIE6Eg7hp/yOn1m3Nts/zCSxSJe+AsB/l4xvh4HbTrZpvCOu5guoR2CkW BAAhc5zPoqFNaNVqLLe9cja0ZF7f5eaHePTx073EMrSISFvNaANNd/lHO7JUak7aRUHQ /4FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=kf7QbjWu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sc24si4751931ejc.355.2021.10.28.02.52.07; Thu, 28 Oct 2021 02:52:31 -0700 (PDT) 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; dkim=pass header.i=@cloudflare.com header.s=google header.b=kf7QbjWu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbhJ1JwI (ORCPT + 99 others); Thu, 28 Oct 2021 05:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhJ1Jvq (ORCPT ); Thu, 28 Oct 2021 05:51:46 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91770C061224 for ; Thu, 28 Oct 2021 02:49:18 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id d23so8311984ljj.10 for ; Thu, 28 Oct 2021 02:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Fk20SFTna7oenyJFMvCkJ++ZR0TFp2usytKYkzVEf0s=; b=kf7QbjWu1KoXK2GcxquXY75XDFKY96HN8PhY+2IdmX0My5dsmxhOifxj3w+ZaB8bI1 mTFK+tYsuwaU9fDQtOw0yMiZeS4i4l45HAoV8jZRaqMfQKixIfM+z9QIDq1gQI2fnCPM cKkuo2/nXat3lC4ncjsZfWKecL2Cq0VFHHxyw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fk20SFTna7oenyJFMvCkJ++ZR0TFp2usytKYkzVEf0s=; b=ha12ITKo8pDh/mSauqcro230WSL4eur3MnhXrYt/n7K2feslaTMbWO/ydOxwHr1pZ9 /ddfj3ERiP0C/PMeog0oarrFHHgGOjnUqKc3r0D5PldlhXvIOj9xLkSjVL2xub6xFk70 jevmdDVeiXRR86TYobNz7dkVYhRmMPd4u37654lAaqz/esJNu8j6Qj05lf09kNnqyIcg tc/5TCQYX1DisgFDSMswWTvTHNPisMzCwCitd8v7xiU0wFjIOT70Of74kKtPweSS4nci M1CI4Pp9f1qng7O6GI6DsrHIag/Tc183GMyPCKYsJvsFPJk6Ln5fgrpMeLdEC9w8QL+6 NeGw== X-Gm-Message-State: AOAM533n/gJDv/Ib3eX8ceJAEjbJU9juS+KmwnXgwE77SM1ZDcZoMwOa dIVXHdwMLAj+W8my7cs/Pa8WjhKFcahiNs1h0Uj97g== X-Received: by 2002:a05:651c:2328:: with SMTP id bi40mr3584357ljb.121.1635414556987; Thu, 28 Oct 2021 02:49:16 -0700 (PDT) MIME-Version: 1.0 References: <20211021151528.116818-1-lmb@cloudflare.com> <20211021151528.116818-2-lmb@cloudflare.com> In-Reply-To: From: Lorenz Bauer Date: Thu, 28 Oct 2021 10:49:06 +0100 Message-ID: Subject: Re: [PATCH bpf-next v2 1/3] libfs: support RENAME_EXCHANGE in simple_rename() To: Miklos Szeredi Cc: Daniel Borkmann , Alexander Viro , Alexei Starovoitov , Andrii Nakryiko , kernel-team , linux-fsdevel , lkml , Networking , bpf , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Oct 2021 at 09:43, Miklos Szeredi wrote: > > This is not sufficient. RENAME_EXCHANGE can swap a dir and a > non-dir, in which case the parent nlink counters need to be fixed up. > > See shmem_exchange(). My suggestion is to move that function to > libfs.c:simple_rename_exchange(). Thanks for the pointer, I sent a v3. Lorenz -- Lorenz Bauer | Systems Engineer 6th Floor, County Hall/The Riverside Building, SE1 7PB, UK www.cloudflare.com