Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] nfsd: fix file memleak on client_opens_relaese
@ 2023-11-10 18:21 Mahmoud Adam
  2023-11-10 21:31 ` NeilBrown
  2023-11-10 21:35 ` Jeff Layton
  0 siblings, 2 replies; 4+ messages in thread
From: Mahmoud Adam @ 2023-11-10 18:21 UTC (permalink / raw)
  To: chuck.lever, jlayton; +Cc: neilb, kolga, Dai.Ngo, tom, linux-nfs, Mahmoud Adam

seq_release should be called to free the allocated seq_file

Cc: stable@vger.kernel.org # v5.3+
Signed-off-by: Mahmoud Adam <mngyadam@amazon.com>
---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 4045c852a450..40415929e2ae 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -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

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

* Re: [PATCH] nfsd: fix file memleak on client_opens_relaese
  2023-11-10 18:21 [PATCH] nfsd: fix file memleak on client_opens_relaese Mahmoud Adam
@ 2023-11-10 21:31 ` NeilBrown
  2023-11-10 21:55   ` Chuck Lever III
  2023-11-10 21:35 ` Jeff Layton
  1 sibling, 1 reply; 4+ messages in thread
From: NeilBrown @ 2023-11-10 21:31 UTC (permalink / raw)
  To: Mahmoud Adam
  Cc: chuck.lever, jlayton, kolga, Dai.Ngo, tom, linux-nfs,
	Mahmoud Adam

On Sat, 11 Nov 2023, Mahmoud Adam wrote:
> seq_release should be called to free the allocated seq_file
> 
> Cc: stable@vger.kernel.org # v5.3+
> Signed-off-by: Mahmoud Adam <mngyadam@amazon.com>

Fixes: 78599c42ae3c ("nfsd4: add file to display list of client's opens")
Reviewed-by: NeilBrown <neilb@suse.de>

Thanks,
NeilBrown
 

> ---
>  fs/nfsd/nfs4state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 4045c852a450..40415929e2ae 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -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
> 


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

* Re: [PATCH] nfsd: fix file memleak on client_opens_relaese
  2023-11-10 18:21 [PATCH] nfsd: fix file memleak on client_opens_relaese Mahmoud Adam
  2023-11-10 21:31 ` NeilBrown
@ 2023-11-10 21:35 ` Jeff Layton
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2023-11-10 21:35 UTC (permalink / raw)
  To: Mahmoud Adam, chuck.lever; +Cc: neilb, kolga, Dai.Ngo, tom, linux-nfs

On Fri, 2023-11-10 at 19:21 +0100, Mahmoud Adam wrote:
> seq_release should be called to free the allocated seq_file
> 
> Cc: stable@vger.kernel.org # v5.3+
> Signed-off-by: Mahmoud Adam <mngyadam@amazon.com>
> ---
>  fs/nfsd/nfs4state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 4045c852a450..40415929e2ae 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -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: Jeff Layton <jlayton@kernel.org>

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

* Re: [PATCH] nfsd: fix file memleak on client_opens_relaese
  2023-11-10 21:31 ` NeilBrown
@ 2023-11-10 21:55   ` Chuck Lever III
  0 siblings, 0 replies; 4+ messages in thread
From: Chuck Lever III @ 2023-11-10 21:55 UTC (permalink / raw)
  To: Neil Brown
  Cc: Mahmoud Adam, Jeff Layton, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Linux NFS Mailing List



> On Nov 10, 2023, at 4:31 PM, NeilBrown <neilb@suse.de> wrote:
> 
> On Sat, 11 Nov 2023, Mahmoud Adam wrote:
>> seq_release should be called to free the allocated seq_file
>> 
>> Cc: stable@vger.kernel.org # v5.3+
>> Signed-off-by: Mahmoud Adam <mngyadam@amazon.com>
> 
> Fixes: 78599c42ae3c ("nfsd4: add file to display list of client's opens")

Agreed, and pushed to nfsd-fixes.


> Reviewed-by: NeilBrown <neilb@suse.de>
> 
> Thanks,
> NeilBrown
> 
> 
>> ---
>> fs/nfsd/nfs4state.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
>> index 4045c852a450..40415929e2ae 100644
>> --- a/fs/nfsd/nfs4state.c
>> +++ b/fs/nfsd/nfs4state.c
>> @@ -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
>> 
> 

--
Chuck Lever



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

end of thread, other threads:[~2023-11-10 21:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-10 18:21 [PATCH] nfsd: fix file memleak on client_opens_relaese Mahmoud Adam
2023-11-10 21:31 ` NeilBrown
2023-11-10 21:55   ` Chuck Lever III
2023-11-10 21:35 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox