nfsd: remove /proc/fs/nfs when create /proc/fs/nfs/exports error
Subsystems (2)
PATCH 1/2 nfsd: remove /proc/fs/nfs when create /proc/fs/nfs/exports error
when create /proc/fs/nfs/exports error, we should remove /proc/fs/nfs, if don't do it, it maybe cause Memory leak.
Signed-off-by fanchaoting <[email protected]>
Reviewed-by chendt.fnst <[email protected]>
--- fs/nfsd/nfsctl.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/nfsd/nfsctl.c +3 -1
@@ -1102,8 +1102,10 @@ static int create_proc_exports_entry(void)return -ENOMEM ; entry =proc_create ("exports" ,0 , entry, &exports_proc_operations); -if (!entry) +if (!entry) { +remove_proc_entry ("fs/nfs" ,NULL );return -ENOMEM ; + } return 0; }#else /* CONFIG_PROC_FS */
Signature · 1 line
1.7.1
Thanks, applying.
--b.
Quoted 30 lines · fanchaoting
when create
/proc/fs/nfs/exportserror, we should remove/proc/fs/nfs, if don't do it, it maybe cause Memory leak.Signed-off-by fanchaoting <[email protected]>Reviewed-by chendt.fnst <[email protected]>--- fs/nfsd/nfsctl.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fs/nfsd/nfsctl.c +3
-1@@ -1102,8 +1102,10 @@ static int create_proc_exports_entry(void)return -ENOMEM ; entry =proc_create ("exports" ,0 , entry, &exports_proc_operations); -if (!entry) +if (!entry) { +remove_proc_entry ("fs/nfs" ,NULL );return -ENOMEM ; + } return 0; }#else /* CONFIG_PROC_FS */ Signature · 1 line
1.7.1
Quoted 5 lines · fanchaoting
when create
/proc/fs/nfs/exportserror, we should remove/proc/fs/nfs, if don't do it, it maybe cause Memory leak.Signed-off-by fanchaoting <[email protected]>Reviewed-by chendt.fnst <[email protected]>
I merged this patch into pnfsd-block as well
to compliment
a55abd8 pnfsd-block: block layout should cleanup when register nfsd filesystem error
Thanks,
Benny
Quoted 22 lines
--- fs/nfsd/nfsctl.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fs/nfsd/nfsctl.c +3
-1@@ -1102,8 +1102,10 @@ static int create_proc_exports_entry(void)return -ENOMEM ; entry =proc_create ("exports" ,0 , entry, &exports_proc_operations); -if (!entry) +if (!entry) { +remove_proc_entry ("fs/nfs" ,NULL );return -ENOMEM ; + } return 0; }#else /* CONFIG_PROC_FS */