All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Steve Dickson <SteveD@RedHat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] Removed -Werror=unused-result warnings.
Date: Tue, 6 Mar 2018 10:33:35 -0500	[thread overview]
Message-ID: <20180306153335.GA7099@fieldses.org> (raw)
In-Reply-To: <86fae36c-2542-2c00-6993-d4f4d936c83b@RedHat.com>

On Mon, Mar 05, 2018 at 05:49:26PM -0500, Steve Dickson wrote:
> 
> 
> On 03/05/2018 04:53 PM, J. Bruce Fields wrote:
> > On Mon, Mar 05, 2018 at 10:54:20AM -0500, Steve Dickson wrote:
> >> Signed-off-by: Steve Dickson <steved@redhat.com>
> >> ---
> >>  support/nfs/nfs_mntent.c         | 3 ++-
> >>  utils/blkmapd/device-discovery.c | 6 ++++--
> >>  utils/mount/network.c            | 8 ++++++--
> >>  utils/nfsd/nfssvc.c              | 5 +++--
> >>  utils/statd/statd.c              | 3 ++-
> >>  5 files changed, 17 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c
> >> index a2118a2..c60988a 100644
> >> --- a/support/nfs/nfs_mntent.c
> >> +++ b/support/nfs/nfs_mntent.c
> >> @@ -150,7 +150,8 @@ nfs_addmntent (mntFILE *mfp, struct mntent *mnt) {
> >>  		res = fflush(mfp->mntent_fp);
> >>  		if (res < 0)
> >>  			/* Avoid leaving a corrupt mtab file */
> >> -			ftruncate(fileno(mfp->mntent_fp), length);
> >> +			if (ftruncate(fileno(mfp->mntent_fp), length))
> >> +				{/* ignore return value */};
> > 
> > Might be worth a log warning?
> Yes... I thought about that. But I could not think of any meaningful
> log that would help diagnose the problem... The ftruncate() is basically 
> cleanly up a mess.. 
> 
> Maybe log an error message from the fflush()? 

Yeah, and I admit maybe it's not worth anything specifically by the time
the ftruncate also fails.

--b.

  reply	other threads:[~2018-03-06 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-05 15:54 [PATCH] Removed -Werror=unused-result warnings Steve Dickson
2018-03-05 16:06 ` Chuck Lever
2018-03-05 16:39   ` Steve Dickson
2018-03-05 21:53 ` J. Bruce Fields
2018-03-05 22:49   ` Steve Dickson
2018-03-06 15:33     ` J. Bruce Fields [this message]
2018-03-06 15:35       ` Chuck Lever

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=20180306153335.GA7099@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=SteveD@RedHat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.