diff mbox

closing fd associated with /proc/fs/nfsd/export_features

Message ID 20110712.114700.814616059257545652.yamato@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Masatake YAMATO July 12, 2011, 2:47 a.m. UTC
A fd associated with /proc/fs/nfsd/export_features opened in get_export_features is 
not closed.


Signed-off-by: Masatake YAMATO <yamato@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

J. Bruce Fields July 12, 2011, 10:46 a.m. UTC | #1
On Tue, Jul 12, 2011 at 11:47:00AM +0900, Masatake YAMATO wrote:
> A fd associated with /proc/fs/nfsd/export_features opened in get_export_features is 
> not closed.
> 
> 
> Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Acked-by: J. Bruce Fields <bfields@redhat.com>
> 
> diff --git a/support/nfs/exports.c b/support/nfs/exports.c
> index c250383..819a18a 100644
> --- a/support/nfs/exports.c
> +++ b/support/nfs/exports.c
> @@ -787,6 +787,7 @@ struct export_features *get_export_features(void)
>  	fd = read(fd, buf, 50);
>  	if (fd == -1)
>  		goto err;
> +	close(fd);
>  	c = sscanf(buf, "%x %x", &ef.flags, &ef.secinfo_flags);
>  	if (c != 2)
>  		goto err;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index c250383..819a18a 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -787,6 +787,7 @@  struct export_features *get_export_features(void)
 	fd = read(fd, buf, 50);
 	if (fd == -1)
 		goto err;
+	close(fd);
 	c = sscanf(buf, "%x %x", &ef.flags, &ef.secinfo_flags);
 	if (c != 2)
 		goto err;