From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 A17AF3F074F for ; Thu, 7 May 2026 13:22:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778160127; cv=none; b=UbOHIG82OPcpcVFWKqaNgPF8zIkIqJ2cznrnIhONsqVDSoeEVHdwmeFn76NMnjqssKSVq6WvWTzVd89w430N7pvX74/51sBWdHE8BUukTZpbrJ/WpFd32rlFJ3QJL8lFuIZZ7btWQpdk0vjcBdlwcAD5hO5FyplXe007hQgYeOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778160127; c=relaxed/simple; bh=/q/PJm+E2TgviYzGv9urzhsEsn+RogALhj47cQWPBKE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iKwydogAceSKN0bijjBLGc7blYgErafNmEfAMbLQnWTWskAV7MyZa/RfPfrdQpPa36efkgB7qYI1J4GG0/0/lJZIerCDAbFw4fuuZrVRJGTY6CGVNZPqjzUdQJ2jC0BbUON7RK1SMdhl1ttMhJ+/6d8+jzFSqNbKYw0pZ2QB4zU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=permerror header.from=versity.com; spf=pass smtp.mailfrom=versity.com; dkim=pass (2048-bit key) header.d=versity.com header.i=@versity.com header.b=lWuT65zC; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=permerror header.from=versity.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=versity.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=versity.com header.i=@versity.com header.b="lWuT65zC" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-ba3115fe0d5so377408666b.1 for ; Thu, 07 May 2026 06:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=versity.com; s=google; t=1778160124; x=1778764924; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=d5ypHmt7oj428Dz7RFlXIQ479U9qj5uTm/surXuIWPI=; b=lWuT65zC+UDeEIUh+2XhNH/FIopGj43bZ1Vxujoeavjea8EEsj0EP+lmnZtpwVWaIN nKYf2ZVfLAfIIdg8gUcUssBhM2cKO6HhOQRoCPGZbo/cdX10/9h1XlUwPQ/NXMZ4oEQ3 b4dmz/Tdrt1q34tm1kCHEK/ctrBdz60x01TMz9Kyc4XKrw7CoBwwuVch/XnC7Djq+f9T TeLYRoA9w+rpBFGuqMH33Sm3u3fBn0qz6ijAJ2Jpl9Y1yYrn7ngU0CuQTCMt/kt+9Lyl h8HtAokyoeCgjrRSTDsZBF7p8ulrkyMMiQbYXjyiBaALnQaZ+uHqh2yk2WcY+/y28IRa Y4ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778160124; x=1778764924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=d5ypHmt7oj428Dz7RFlXIQ479U9qj5uTm/surXuIWPI=; b=JzSS+UYBqaju082Ly0IxYTs8YUntvX2OwFSwFSP6F1BlUaJ1E23OkZceHrSFb32bUg 6gtFFvwlTTxCRuXwXNL+14zNX/+IBSpzdKWidjcqLNvdZE0WIXH5Nu/EJ5qwz2XA06fb CFJZpPpxgTUwehf37LpV1Wd/WNcapDFuI5+hLStpvWYJDTJJkoln46XZNgn+ca0L0++2 7fqbMNtuzYyw7RFML3z5sQjrusNPJZMYQa/hkr3R3rf/Ysf75/VT7Rmz3SYsqKrfS05u fyKjCutpGqQThspdP8GoeIT2tJpcl1VwJO4Xpo37fajAFtf3n6sNsjV2rA8RJXgIAHPv Y8mg== X-Gm-Message-State: AOJu0YyF+sdknPktX6CNqBtIvATjNq0tRQN2kbnJXf4KZhpDdkiq7f6a Jzf5RqHSUV53W++al9ieRkfyrhxKhl4VebkMGY3jEsLHcivfE9L1f1Fk7EQlsHk4CAa31z/uG0f dY9XKQuA= X-Gm-Gg: AeBDieu6PBCj9C5ytF50iXg0jCN8fmyoi2Bw/uXwML3cttBVcgwEqu++HR3x6a4nv+h zpPM59BbB7YOX35HnvB9NqDDVYeWJGL+t/fRePjXYRU7xFwAMYtmZDhXR76o8dJPf6pxMotVtR3 KNsJyU4JRVTlSWVFye0q/lznNWRwV5xq3o8CXQwCs9bNy3VlDXxmX3EXoBvklYc5bphOBFL/HT6 vLPZy9i7s9M4KGX2Bt4iNHK4MNzxOECjFQJpyn9TaCHBSNTmNUo2r9k0YtHj7YrhyuiUoP/Om+s hWuV60xtn8VdP5BJW6JQQ4GA9++LtRzOyQEaej90e3Y2/RgsBh2RGq+HRXma24RF8wQfGODXTNM iyC0vBdEoH4VEtPXVt91zYsyyHby6EVaFs809sGhrk7Z5gLBqWPRp8Hi3c+VJGsDXl9fXJNk3Dr UrT7Z1A6SVI0BhZtf3lkz7A4oA4nI/22iSqbgVeQmeaan/rEsepGtanEdOPB600FaW+V8LZKNTp jl0hMKCjZGoSTuVwJHUvekcQQvPP4VXf0tMVneKdMkqdC7I X-Received: by 2002:a17:906:fd87:b0:bc3:a0e9:e0c with SMTP id a640c23a62f3a-bc85c2b4e75mr159107866b.13.1778160123662; Thu, 07 May 2026 06:22:03 -0700 (PDT) Received: from localhost.localdomain (46-117-212-87.ftth.glasoperator.nl. [87.212.117.46]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bc83364c5e3sm80638666b.35.2026.05.07.06.22.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 06:22:03 -0700 (PDT) From: Valerie Aurora To: rpdfs-devel@lists.linux.dev Subject: [PATCH 2/6] rpdfs: add inode change debugging routine Date: Thu, 7 May 2026 15:21:49 +0200 Message-ID: <20260507132153.1161324-3-val@versity.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260507132153.1161324-1-val@versity.com> References: <20260507132153.1161324-1-val@versity.com> Precedence: bulk X-Mailing-List: rpdfs-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit print_inode_change() can be added to copy_vfs_inode_to_rinode() to log what has changed since the last inode update. Signed-off-by: Valerie Aurora --- fs/rpdfs/inode.c | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/fs/rpdfs/inode.c b/fs/rpdfs/inode.c index 428c9081fd75..a2baa862f6a4 100644 --- a/fs/rpdfs/inode.c +++ b/fs/rpdfs/inode.c @@ -87,6 +87,43 @@ static __le64 cpu_ts64_to_le64_ns(struct timespec64 ts) return cpu_to_le64(timespec64_to_ns(&ts)); } +static u64 ts64_to_ns(struct timespec64 ts) +{ + return timespec64_to_ns(&ts); +} + +__always_unused +static inline void print_diff64(char *name, u64 new, u64 old) +{ + if (old != new) + rpdfs_prd("%s: %llu -> %llu (%lld)", name, old, new, new - old); +} + +__always_unused +static void print_inode_change(struct inode *inode, struct rpdfs_inode *rinode) +{ + struct rpdfs_inode_info *ri = RPDFS_I(inode); + + rpdfs_prd("copying inode %lu to rinode", inode->i_ino); + + print_diff64("ino", le64_to_cpu(ri->ig.ino), le64_to_cpu(rinode->ig.ino)); + print_diff64("gen", le64_to_cpu(ri->ig.gen), le64_to_cpu(rinode->ig.gen)); + print_diff64("i_size", i_size_read(inode), le64_to_cpu(rinode->size)); + print_diff64("nlink", inode->i_nlink, le32_to_cpu(rinode->nlink)); + print_diff64("uid", i_uid_read(inode), le32_to_cpu(rinode->uid)); + print_diff64("gid", i_gid_read(inode), le32_to_cpu(rinode->gid)); + print_diff64("mode", inode->i_mode, le32_to_cpu(rinode->mode)); + + print_diff64("atime", ts64_to_ns(inode_get_atime(inode)), le64_to_cpu(rinode->atime_nsec)); + print_diff64("mtime", ts64_to_ns(inode_get_mtime(inode)), le64_to_cpu(rinode->mtime_nsec)); + print_diff64("ctime", ts64_to_ns(inode_get_ctime(inode)), le64_to_cpu(rinode->ctime_nsec)); + print_diff64("crtime", le64_to_cpu(ri->crtime_nsec), le64_to_cpu(rinode->crtime_nsec)); + + print_diff64("dirents", le64_to_cpu(ri->dirents.ref.bnr), le64_to_cpu(rinode->dirents.ref.bnr)); + print_diff64("xattrs", le64_to_cpu(ri->xattrs.ref.bnr), le64_to_cpu(rinode->xattrs.ref.bnr)); + print_diff64("xattr_creates", le64_to_cpu(ri->xattr_creates), le64_to_cpu(rinode->xattr_creates)); +} + static void copy_vfs_inode_to_rinode(struct rpdfs_inode *rinode, struct inode *inode) { struct rpdfs_inode_info *ri = RPDFS_I(inode); @@ -132,11 +169,6 @@ void rpdfs_inode_init_ops(struct inode *inode) } } -static u64 ts64_to_ns(struct timespec64 ts) -{ - return timespec64_to_ns(&ts); -} - /* * Update the vfs inode if the caller's persistent version of the rinode * is more recent. A lot of tasks can be checking a shared inode to see -- 2.49.0