linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ufs: Remove redundant inode number check from ufs_nfs_get_inode
@ 2024-08-22 14:26 sergii.boryshchenko
  2024-08-26  9:12 ` kernel test robot
  2024-08-27 10:03 ` [PATCH v2] " sergii.boryshchenko
  0 siblings, 2 replies; 3+ messages in thread
From: sergii.boryshchenko @ 2024-08-22 14:26 UTC (permalink / raw)
  To: dushistov; +Cc: linux-nfs, linux-fsdevel, linux-kernel, Sergii Boryshchenko

From: Sergii Boryshchenko <sergii.boryshchenko@globallogic.com>

The `ufs_nfs_get_inode` function contains a check to validate the inode number
(`ino`) against the valid range of inode numbers. However, this check is
redundant because the same validation is already performed in the `ufs_iget`
function, which is called immediately afterward.

By removing this redundant check, we simplify the code and avoid unnecessary
double-checking of the inode number, while still ensuring that invalid inode
numbers are properly handled by the `ufs_iget` function.

This change has no impact on the functionality since `ufs_iget` provides the
necessary validation for all callers.

Signed-off-by: Sergii Boryshchenko <sergii.boryshchenko@globallogic.com>
---
 fs/ufs/super.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index bc625788589c..11e8b869e0ba 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -101,9 +101,6 @@ static struct inode *ufs_nfs_get_inode(struct super_block *sb, u64 ino, u32 gene
 	struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
 	struct inode *inode;
 
-	if (ino < UFS_ROOTINO || ino > (u64)uspi->s_ncg * uspi->s_ipg)
-		return ERR_PTR(-ESTALE);
-
 	inode = ufs_iget(sb, ino);
 	if (IS_ERR(inode))
 		return ERR_CAST(inode);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-27 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 14:26 [PATCH] ufs: Remove redundant inode number check from ufs_nfs_get_inode sergii.boryshchenko
2024-08-26  9:12 ` kernel test robot
2024-08-27 10:03 ` [PATCH v2] " sergii.boryshchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).