Skip to contentSkip to conversation

nfsd: fix file memleak on client_opens_relaese

PATCH In review Mahmoud Adam 4 participants 4 messages Nov 10, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: fix file memleak on client_opens_relaese

seq_release should be called to free the allocated seq_file

---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -1
index 4045c852a450..40415929e2ae 100644
@@ -2804,7 +2804,7 @@ static int client_opens_release(struct inode *inode, struct file *file)
 
 	/* XXX: alternatively, we could get/drop in seq start/stop */
 	drop_client(clp);
-	return 0;
+	return seq_release(inode, file);
 }
 
 static const struct file_operations client_states_fops = {

--
2.40.1

Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Mahmoud Adam

seq_release should be called to free the allocated seq_file

Fixes 78599c42ae3c ("nfsd4: add file to display list of client's opens")

Thanks,
NeilBrown

Quoted 20 lines
---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -2
index 4045c852a450..40415929e2ae 100644
@@ -2804,7 +2804,7 @@ static int client_opens_release(struct inode *inode, struct file *file)
 
 	/* XXX: alternatively, we could get/drop in seq start/stop */
 	drop_client(clp);
-	return 0;
+	return seq_release(inode, file);
 }
 
 static const struct file_operations client_states_fops = {
--

2.40.1

#2 lore raw
Quoted 11 lines · NeilBrown
Quoted 4 lines · Mahmoud Adam

seq_release should be called to free the allocated seq_file

Fixes 78599c42ae3c ("nfsd4: add file to display list of client's opens")

Agreed, and pushed to nfsd-fixes.

Quoted 22 lines

Thanks,
NeilBrown

Quoted 16 lines

---
fs/nfsd/nfs4state.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -1
index 4045c852a450..40415929e2ae 100644
@@ -2804,7 +2804,7 @@ static int client_opens_release(struct inode *inode, struct file *file)
 
 /* XXX: alternatively, we could get/drop in seq start/stop */
 drop_client(clp);
- return 0;
+ return seq_release(inode, file);
 }
 
Quoted 5 lines
Quoted 4 lines
fs/nfsd/nfs4state.c +0 -1
 static const struct file_operations client_states_fops = {
--

2.40.1

--
Chuck Lever

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Mahmoud Adam
Quoted 22 lines · Mahmoud Adam

seq_release should be called to free the allocated seq_file

---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -2
index 4045c852a450..40415929e2ae 100644
@@ -2804,7 +2804,7 @@ static int client_opens_release(struct inode *inode, struct file *file)
 
 	/* XXX: alternatively, we could get/drop in seq start/stop */
 	drop_client(clp);
-	return 0;
+	return seq_release(inode, file);
 }
 
 static const struct file_operations client_states_fops = {
--
Quoted 1 line

2.40.1