From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792777836; b=ez9GRzPPY/ihuYs8BrpeRsVX1Y2wb8eEJIqMUhMBEuao777612vZwvE2fqwnpCnBxGRh 49Gv+StlomL7Mi3drkwYgNBfWl+cnRYYyCHvbOBZlVqj/hs/Mhvg+YWKlUvhGeQVWdCqC 5RAY+sUOPTOHE+nCRDhEvud9EUO+eNCv0rItF1WjOcx/bx9OUlrxN0lIQ4LMczyfHU4hH A5nz+gG+cPN3laYoTMqdeMaC4WZihNlOGvAXzhbjA27DqExXAUGals6VTUjHK17CGsbGJ F5VzPnweYguVW5a1YOFUkSKrYDYKPtI7DyMUqNZr01EMpkkC/YrfXyVpGEq+OpMMnxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792777836; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=pFWKr11e0y53/1AOBWpBWCWQ4Q5+eTpZNd5Ve4YEWE4=; b=GDFxcIO8q5M0S6wugWTpRjMbA0vdoW61/5N9mhvJFpJzHpKhTIUthPk2PiEY3ExauauY hV6n651oC4OTDGOaJmCtZE0YO1cS2oFGBsAmDGfnHNW4qaNd8UAEHdRr8AQup8zeqL2eH +WAw3ffEm32S9xBH3Kt3Hx/nVMuMHx4x0THC7e6fCkGA1Zl238EeOnUF2PL35VVumlXNZ yTPuARIKaOVe19TcqxpYuy1gEuVBRYG4Sm2FTBHT49s+XM5ZRuPDcj+L8K4qn7+LIUkxp 7UPrlNd6b59i/yAf/D92p/EiBGRE5K2evJ84BAX7hpwXmfNOxH7u4EWBhQ9OnPmZrFQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=zabbo.net; spf=pass smtp.mailfrom=zabbo.net; dkim=pass header.d=zabbo.net header.i=@zabbo.net header.a=rsa-sha256 header.s=google header.b="lBki/9CK"; arc=none smtp.remote-ip=209.85.216.52 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE8F2606A321 for ; Fri, 23 Oct 2026 17:50:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CE8F2606A321 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zabbo.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zabbo.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=zabbo.net header.i=@zabbo.net header.a=rsa-sha256 header.s=google header.b=lBki/9CK Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-3a7cfe8f761so1283283a91.1 for ; Fri, 23 Oct 2026 10:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zabbo.net; s=google; t=1792777835; x=1793382635; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=pFWKr11e0y53/1AOBWpBWCWQ4Q5+eTpZNd5Ve4YEWE4=; b=lBki/9CKoUAcnJ5Q7j/TIXd2c9v/ErjhuDQnuXFJqY/KFslJge1fAZlY64inu1oaxv 3w0w8MCYr712Kggs3DERMRt95+N43ezW1EkeF7zOYXvYfLwT32W7E0vw3ZmlAGhKGn5Q IkxtamTuxQ7W17SD7iROGQGBDcH2webIG9A/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792777835; x=1793382635; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=pFWKr11e0y53/1AOBWpBWCWQ4Q5+eTpZNd5Ve4YEWE4=; b=zxepbeF9/ywlg/peKh3+yljLEudS+y33X3a7bdwV9u2w12jEPThHBBHBpX+3r5hxyG DVvNn1gMxj1ZEE/PK/2pWAO9fIcn1KsQLwchBToh34dwEuYNtNciDgHsTPhs5c+AIgKy pNoOVfvDdqYw8fpXG7yWgasgZLmh7vFrbwlc3HA63b85YKQZgJIVGkystv7agfJ1f5Kp g+GbaiU0I3N+ceLEu8GFHP3sNgwJt1o7xWmfQeY1X61nBThlKtb2EMMRzRfzFdEnr3kB fqNqekktcWqOMSxmrnyJ9qaO2DgpzURzI8d2zD+l28dMKrWmZbfTsKFHPoHEjWrObjQz E01A== X-Gm-Message-State: AFq9FYLvk/dSGmkGv8sepwb5zzcBdTcpbaG8ctjTFUgth3yQ7ZbCaw9F J1t3RmHk3u2YzlNsGMd3kyVUsaO3Otd08Nclxr2g6G/LHH6WbcF78DukyHOmKpkTM6w= X-Gm-Gg: AYBFou3JpmZSlK0Z8YeVa7IhFF3PftYZClMlrJye9ZhPFROqw5OhnAJDfjQPztn5Izk uJLByD9LMoJZIq/Jr6cxzyNwI7GAbjqE718Qj+6hJfylpDwBPMUI3Ly9qsdvTlpwxWSiLmNWnzV CloR3Fs96nCfzsvCEH/LpJVLvo2miqACrPUBH4xWW9oAcJg5+R1nfGv4IFs4FikYT7NfpTf/oO2 1zUxSlrupZNwLiBP7njw8VUCvwTtYVBOyWjn6Twq1mHGHvjcudc/XwjcAWn+yMzToFFEHpW58Ok eanxQs3iKUMUAPtD5+9toMACW1zXQUpmlFi0tl/cl+P9vHL56ixNw6+On0L+vpnnDK30Xn0Pg49 z1xoAgcra24zQfxzUs1z4tsrsT8xggio9omUGLUI/zhAL2rLzz62BlU7at15ipyhtenKg8T1ZTB yczUREDpjgYgDvLOmfnmRbNeKfkS9gr/sAyCY5BpdZjqqnlfgMPvY0/BlQXTiMntikRJ5G0lpLO lb4SY00cbtUyyrQZnY+oQM9tbzYrwd94K6HDD9HLQ== X-Received: by 2002:a17:90a:f94f:b0:3ab:d26b:c2df with SMTP id 98e67ed59e1d1-3adeb5e423cmr8773a91.27.1792777834674; Fri, 23 Oct 2026 10:50:34 -0700 (PDT) Received: from localhost ([50.39.133.72]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ade3ed4e33sm399300a91.2.2026.10.23.10.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2026 10:50:34 -0700 (PDT) Date: Fri, 23 Oct 2026 10:50:33 -0700 From: Zach Brown To: Chris Kirby Cc: rpdfs-devel@lists.linux.dev Subject: Re: [PATCH 1/1] rpdfs: Add support for rpdfs_link() Message-ID: <20261023175033.GD1408936@localhost.localdomain> References: X-Mailing-List: rpdfs-devel@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Oct 19, 2026 at 06:21:50PM +0000, Chris Kirby wrote: > +static int rpdfs_link(struct dentry *old_dentry, struct inode *new_dir, > + struct dentry *new_dentry) > +{ > + struct rpdfs_fs_info *rfi = RPDFS_INODE_FS(new_dir); > + struct inode *old_inode = d_inode(old_dentry); > + struct inode *new_inode = d_inode(new_dentry); > + struct inode *old_dir = d_inode(old_dentry->d_parent); I'm guessing a lot of this code was lifted from rename. In _link we don't need to access the old_dir at all. Take a peek at other link implementations, the pattern seems to be: link(old_dentry, dir, dentry) { inode = d_inode(dentry); } Then we don't need to validate the old dir's dentry name (so we can just have one "da"), lock it, update it, etc. > + rpdfs_inode_update(rfi, old_inode); > + rpdfs_inode_update(rfi, old_dir); > + if (new_dir != old_dir) > + rpdfs_inode_update(rfi, new_dir); > + > +out_unlock: > + rpdfs_rlock_unlock(rfi, &old_dir_hold); > + rpdfs_rlock_unlock(rfi, &new_dir_hold); > + rpdfs_rlock_unlock(rfi, &old_inode_hold); > + rpdfs_rlock_unlock(rfi, &new_inode_hold); There's a (unfortunate, gross) pattern here where insert_entry can have modified the dir's dirent eht blocks before returning an error. We always need to update the dir if we've called insert_, even on error. I'm open to ways to clean it up so it's not down to us remembering that this is the case :(. - z