lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 12 Apr 2019 11:57:33 +0100
From:   Colin King <colin.king@...onical.com>
To:     Mike Marshall <hubcap@...ibond.com>,
        Martin Brandenburg <martin@...ibond.com>,
        devel@...ts.orangefs.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] orangefs: remove redundant code

From: Colin Ian King <colin.king@...onical.com>

The check of inode->i_state & I_DIRTY_PAGES is redundant as it
just does the same actions as the following code when the condition
is false.  Although it shows the intention of what to do when
I_DIRTY_PAGES is set I think removing the redunant check is preferable.

Addresses-Coverity: ("Identical code for different branches")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 fs/orangefs/orangefs-utils.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index 523e7f9fc2e9..d4b7ae763186 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -253,10 +253,6 @@ int orangefs_inode_getattr(struct inode *inode, int flags)
 			write_inode_now(inode, 1);
 			goto again;
 		}
-		if (inode->i_state & I_DIRTY_PAGES) {
-			spin_unlock(&inode->i_lock);
-			return 0;
-		}
 		spin_unlock(&inode->i_lock);
 		return 0;
 	}
-- 
2.20.1

Powered by blists - more mailing lists