From 4f0cd59bfed63e5fd2d9472f1b8fc5fe308e9431 Mon Sep 17 00:00:00 2001
From: Gurjeet Singh <gurjeet@singh.im>
Date: Mon, 12 Jun 2023 22:39:33 -0700
Subject: [PATCH v2] Remove always true_checks

The lines above the check had just referenced the struct member, so the
check is unnecessary, as it will always yeild true.
---
 src/backend/storage/buffer/bufmgr.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 3c59bbd04e..dd418f3814 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -907,9 +907,7 @@ ExtendBufferedRelTo(ExtendBufferedWhat eb,
 	{
 		LockRelationForExtension(eb.rel, ExclusiveLock);
 
-		/* could have been closed while waiting for lock */
-		if (eb.rel)
-			eb.smgr = RelationGetSmgr(eb.rel);
+		eb.smgr = RelationGetSmgr(eb.rel);
 
 		/* recheck, fork might have been created concurrently */
 		if (!smgrexists(eb.smgr, fork))
@@ -1875,8 +1873,7 @@ ExtendBufferedRelShared(ExtendBufferedWhat eb,
 	if (!(flags & EB_SKIP_EXTENSION_LOCK))
 	{
 		LockRelationForExtension(eb.rel, ExclusiveLock);
-		if (eb.rel)
-			eb.smgr = RelationGetSmgr(eb.rel);
+		eb.smgr = RelationGetSmgr(eb.rel);
 	}
 
 	/*
-- 
2.35.1

