Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CCDD32939F for ; Wed, 25 Feb 2026 23:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772061023; cv=none; b=fCl5H20ZMQv6F/lVqH5G8oN2fatLxjS1zvxyQ/z+4cNyTTuCRm4hW4vGbd0h+T9loibCBQ8UM8PwaIQeND2Jk4JRsrAaCddHZABbpNU6J//ifJSuP1msF6XCHYCP1oUd/9V+Il1NZwG+868JKQcrto0BXEnrjH0sYyacbVJSBwc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772061023; c=relaxed/simple; bh=My7E9EZVut0ywx5bTmrJ3q9Wx+45qXBUkrRUWpXoNmg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KfqVwNKSAdIkXTXHzxfJNt8eK9i9qMFfpk7rmZxiPm+GDqypj7iRDdOcpqJb+J4xLwYE59m/w9hJgHqiy+5E2/TVCSPzUmP0KCoclUxyVutweyGTgZOkaa1uzL85+MwE3gLAzRrdVJwNqC53eOdWS8Y2TQYO4ZU//0jv2jRSnpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zabbo.net; spf=pass smtp.mailfrom=zabbo.net; dkim=pass (1024-bit key) header.d=zabbo.net header.i=@zabbo.net header.b=icU2kbJv; arc=none smtp.client-ip=209.85.210.170 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) header.d=zabbo.net header.i=@zabbo.net header.b="icU2kbJv" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-823210d1d8eso150370b3a.1 for ; Wed, 25 Feb 2026 15:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zabbo.net; s=google; t=1772061022; x=1772665822; darn=lists.linux.dev; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=R1Zo28FP/1KjPijLuTHYhrUMO4WetwIliJaLkWxifI4=; b=icU2kbJvICtbJ/JmTJTCJ/m5TyMCUCpIpIcyKlAgrY6yoQ40SP6lNFakuTGdXpcNJA BKWUbhNf2BK2srEkGlDbE4ERJVYSZ7Gs8IZJ1uu6UdJ/jk0tKSnPaLQq+x+Owo9jTXGo CE1HCdhA1Urros67dAksFfH7MUBNveXs6o1ks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772061022; x=1772665822; h=in-reply-to:content-disposition: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; bh=R1Zo28FP/1KjPijLuTHYhrUMO4WetwIliJaLkWxifI4=; b=MAiMw0BOOOTO0k243KQIWZycST7M2POTMHN1UZqfSHOBUta90otfrNNKYs3chHlgLY OqzN+6+VzzODbe1Wl0NlrZI5U3wyTNDUxnouMhfA7daNGRD/OAsdPHvY2iymQR+XjoRf +iNhnuHFcuU6SCcAfPDBTYJPeySi84Uq/AmzdtpKG8L8WGax2gn0Q1QovdacOgAIYG8M 01atdVMfvpvWWFx8FjKf9EQiVzgFYx0uq5oG0zrr3wVgh2PKLltWB+nmFtfbZn8uMn30 tfxcTuZBrN5Met9ZnxDnRn7wZxQKwWpWF8QRRfHd+Fp9jLKveqPfNh+IsHNz+9NTZX0O 6gcw== X-Gm-Message-State: AOJu0Yy/42B9pNgCpjtMZx5XHRC9vrT1iVTcrxCMfMk4CASufWaJ8gH1 7TIQN1MjE90Q/gxKvNxEOF7E7RmTt4Oiek53Wjb05irrhE+EbvaBr2z3GQ/EOF9IL3k= X-Gm-Gg: ATEYQzzUX/O/cwcf9FVfp7OvSD/tYUCs04ux4P0yLWgHo69Qe5Lb3pfVBH+pZ6bytZ1 6bxJqpsubiArWGGTlsPbXbdmVH+Q318B9IblsN+lbs2JfIvKqURAiKggOFmPV7/gEHVpr/zS2xI FkrowaTKqA7oDIwrMXb5S9fvjZ2B/6uqwx1WgUIGd74gvFHQf1nj4XWwzbd+T0RsoN5acHtc0lj mHHLqdTeGo4SkdMfhM3vRH1CtOrP05ZLeMp9w7mqinMmqxfsXYLSX1PeOzic9BtnjPWCJHxkrxb bZjpbS42G+yD/AXisvNtpU/9Ykldpm1aTeye/JhpgZcoDTDutDWvBjwQiLXyBwOe3VPAqxn6Bh7 eiXAiOJ2JQShtVZ7+loJexx4/sc6KA6dcTrf0NMwEKGk8b92IVnWdlee1hVnMKgD3tMywTqfQGQ AnwdQT0T25+75P8nmV+sFD X-Received: by 2002:a05:6a21:487:b0:38e:7422:ac83 with SMTP id adf61e73a8af0-395ad05c116mr1711613637.10.1772061021771; Wed, 25 Feb 2026 15:10:21 -0800 (PST) Received: from localhost ([50.39.133.72]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c70fa801963sm89420a12.21.2026.02.25.15.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 15:10:21 -0800 (PST) Date: Wed, 25 Feb 2026 15:10:20 -0800 From: Zach Brown To: Valerie Aurora Cc: rpdfs-devel@lists.linux.dev Subject: Re: [PATCH 2/2] Add rpdfs_rmdir() Message-ID: <20260225231020.GE2876476@localhost.localdomain> References: <20260224164157.2591-1-val@versity.com> <20260224164157.2591-3-val@versity.com> Precedence: bulk X-Mailing-List: rpdfs-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260224164157.2591-3-val@versity.com> On Tue, Feb 24, 2026 at 05:41:57PM +0100, Valerie Aurora wrote: > Copied from rpdfs_rename() and the extra bits removed. ... > + /* update vfs inodes: first dir sizes and times */ > + i_size_write(dir, i_size_read(dir) - dentry->d_name.len); > + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); > + > + /* now inode nlink and times */ > + if (inode->i_nlink < 2) > + pr_warn("deleting dir %.*s with link count %d < 2", > + dentry->d_name.len, dentry->d_name.name, inode->i_nlink); I'm not sure how I feel about this warning. I could see just not bothering to warn about inconsistency, like we did up there with the i_size_write() changing a possibly bad existing size. If we warned we'd probably want to show the inode number of the dir and inode? Otherwise it doesn't seem particularly helpful. (Eventually we'll probably want a warning wrapper in pr.h that shows some indication of which fs as well, like the sb_id for debugging. But nothing yet.) Definitely don't print names on the console, though. They can be sensitive or absolute nonsense. 255 ascii bells :). But more importantly.. > + else > + clear_nlink(inode); _unlink() and _rmdir() are identical, except for the magic silly decrease of nlink on behalf of . and .. when the inode is a dir. It looks like this gets the inode nlink dec right, but misses the dec of the parent nlink. Oh, and I guess testing that the dir is empty or returning ENOTEMPTY. Instead of having two copies, just have unlink use S_ISDIR for the dir differences. Then the .rmdir and .unlink ops can both point to unlink. - z