linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Masatake YAMATO <yamato@redhat.com>
Cc: bfields@fieldses.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH v3] closing fd associated with /proc/fs/nfsd/export_features
Date: Tue, 12 Jul 2011 10:03:04 -0400	[thread overview]
Message-ID: <4E1C5418.2000800@RedHat.com> (raw)
In-Reply-To: <20110712.220109.419121694701200961.yamato@redhat.com>



On 07/12/2011 09:01 AM, Masatake YAMATO wrote:
> Very sorry for posting again and again.
> fd shuold be closed even if read is failed.
> 
> Signed-off-by: Masatake YAMATO <yamato@redhat.com>
> 
> diff --git a/support/nfs/exports.c b/support/nfs/exports.c
> index c250383..c96500f 100644
> --- a/support/nfs/exports.c
> +++ b/support/nfs/exports.c
> @@ -784,8 +784,9 @@ struct export_features *get_export_features(void)
>  	fd = open(path, O_RDONLY);
>  	if (fd == -1)
>  		goto good;
> -	fd = read(fd, buf, 50);
> -	if (fd == -1)
> +	c = read(fd, buf, 50);
> +	close(fd);
> +	if (c == -1)
>  		goto err;
>  	c = sscanf(buf, "%x %x", &ef.flags, &ef.secinfo_flags);
>  	if (c != 2)
> 
Committed...

steved.

  reply	other threads:[~2011-07-12 14:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12  2:47 [PATCH] closing fd associated with /proc/fs/nfsd/export_features Masatake YAMATO
2011-07-12 10:46 ` J. Bruce Fields
2011-07-12 12:38   ` [PATCH v2] " Masatake YAMATO
2011-07-12 13:01     ` [PATCH v3] " Masatake YAMATO
2011-07-12 14:03       ` Steve Dickson [this message]
2011-07-12 14:20       ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E1C5418.2000800@RedHat.com \
    --to=steved@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=yamato@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).