linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][SMB311] remove dead code for non-compounded SMB311 posix query info
@ 2021-06-19 21:28 Steve French
  2021-06-19 21:35 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Steve French @ 2021-06-19 21:28 UTC (permalink / raw)
  To: CIFS

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

Although we may need this in some cases in the future, remove the
currently unused, non-compounded version of POSIX query info,
SMB11_posix_query_info (instead smb311_posix_query_path_info is now
called e.g. when revalidating dentries or retrieving info for getattr)

Addresses-Coverity: 1495708 ("Resource leaks")

-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb311-remove-dead-code-for-non-compounded-posix-que.patch --]
[-- Type: text/x-patch, Size: 1659 bytes --]

From 4f0bac6b66da3618d71b89f3c98faec5d1c3fac8 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Sat, 19 Jun 2021 16:19:09 -0500
Subject: [PATCH] smb311: remove dead code for non compounded posix query info

Although we may need this in some cases in the future, remove the
currently unused, non-compounded version of POSIX query info,
SMB11_posix_query_info (instead smb311_posix_query_path_info is now
called e.g. when revalidating dentries or retrieving info for getattr)

Addresses-Coverity: 1495708 ("Resource leaks")
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/smb2pdu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 4a244cc4e902..98586876a955 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -3484,6 +3484,8 @@ int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon,
 			  NULL);
 }
 
+#ifdef 0
+/* currently unused, as now we are doing compounding instead (see smb311_posix_query_path_info) */
 int
 SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
 		u64 persistent_fid, u64 volatile_fid, struct smb311_posix_qinfo *data, u32 *plen)
@@ -3495,7 +3497,9 @@ SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
 	return query_info(xid, tcon, persistent_fid, volatile_fid,
 			  SMB_FIND_FILE_POSIX_INFO, SMB2_O_INFO_FILE, 0,
 			  output_len, sizeof(struct smb311_posix_qinfo), (void **)&data, plen);
+	/* Note caller must free "data" (passed in above). It may be allocated in query_info call */
 }
+#endif
 
 int
 SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon,
-- 
2.30.2


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

* Re: [PATCH][SMB311] remove dead code for non-compounded SMB311 posix query info
  2021-06-19 21:28 [PATCH][SMB311] remove dead code for non-compounded SMB311 posix query info Steve French
@ 2021-06-19 21:35 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2021-06-19 21:35 UTC (permalink / raw)
  To: CIFS

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

Corrected typo and reattached


On Sat, Jun 19, 2021 at 4:28 PM Steve French <smfrench@gmail.com> wrote:
>
> Although we may need this in some cases in the future, remove the
> currently unused, non-compounded version of POSIX query info,
> SMB11_posix_query_info (instead smb311_posix_query_path_info is now
> called e.g. when revalidating dentries or retrieving info for getattr)
>
> Addresses-Coverity: 1495708 ("Resource leaks")
>
> --
> Thanks,
>
> Steve



-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb311-remove-dead-code-for-non-compounded-posix-que.patch --]
[-- Type: text/x-patch, Size: 1656 bytes --]

From 4f0bac6b66da3618d71b89f3c98faec5d1c3fac8 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Sat, 19 Jun 2021 16:19:09 -0500
Subject: [PATCH] smb311: remove dead code for non compounded posix query info

Although we may need this in some cases in the future, remove the
currently unused, non-compounded version of POSIX query info,
SMB11_posix_query_info (instead smb311_posix_query_path_info is now
called e.g. when revalidating dentries or retrieving info for getattr)

Addresses-Coverity: 1495708 ("Resource leaks")
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/smb2pdu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 4a244cc4e902..98586876a955 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -3484,6 +3484,8 @@ int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon,
 			  NULL);
 }
 
+#if 0
+/* currently unused, as now we are doing compounding instead (see smb311_posix_query_path_info) */
 int
 SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
 		u64 persistent_fid, u64 volatile_fid, struct smb311_posix_qinfo *data, u32 *plen)
@@ -3495,7 +3497,9 @@ SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
 	return query_info(xid, tcon, persistent_fid, volatile_fid,
 			  SMB_FIND_FILE_POSIX_INFO, SMB2_O_INFO_FILE, 0,
 			  output_len, sizeof(struct smb311_posix_qinfo), (void **)&data, plen);
+	/* Note caller must free "data" (passed in above). It may be allocated in query_info call */
 }
+#endif
 
 int
 SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon,
-- 
2.30.2


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

end of thread, other threads:[~2021-06-19 21:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-19 21:28 [PATCH][SMB311] remove dead code for non-compounded SMB311 posix query info Steve French
2021-06-19 21:35 ` Steve French

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).