linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/4] xfs_scrub: close dir_fd if we don't get a DIR pointer
Date: Fri, 2 Feb 2018 15:39:51 -0600	[thread overview]
Message-ID: <59ab35b1-95fc-1797-8fec-83027343f6bb@redhat.com> (raw)
In-Reply-To: <151760739333.29371.879810257810332609.stgit@magnolia>

On 2/2/18 3:36 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> If we don't get a directory pointer, close dir_fd before jumping out.
> 
> Fixes-coverity-id: 1428799
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  scrub/vfs.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> 
> diff --git a/scrub/vfs.c b/scrub/vfs.c
> index e3c8e62..573a2d0 100644
> --- a/scrub/vfs.c
> +++ b/scrub/vfs.c
> @@ -88,6 +88,7 @@ scan_fs_dir(
>  	/* Caller-specific directory checks. */
>  	if (!sft->dir_fn(ctx, sftd->path, dir_fd, sft->arg)) {
>  		sft->moveon = false;
> +		close(dir_fd);
>  		goto out;
>  	}
>  
> @@ -95,6 +96,7 @@ scan_fs_dir(
>  	dir = fdopendir(dir_fd);
>  	if (!dir) {
>  		str_errno(ctx, sftd->path);
> +		close(dir_fd);
>  		goto out;
>  	}
>  	rewinddir(dir);
> 


  reply	other threads:[~2018-02-02 21:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 21:36 [PATCH 0/4] xfsprogs: 4.15 rollup pt. 4 Darrick J. Wong
2018-02-02 21:36 ` [PATCH 1/4] mkfs: don't create realtime filesystems with reflink enabled Darrick J. Wong
2018-02-02 21:38   ` Eric Sandeen
2018-02-02 21:36 ` [PATCH 2/4] xfs_scrub: close dir_fd if we don't get a DIR pointer Darrick J. Wong
2018-02-02 21:39   ` Eric Sandeen [this message]
2018-02-02 21:36 ` [PATCH 3/4] xfs_scrub: kill dead code Darrick J. Wong
2018-02-02 21:46   ` Eric Sandeen
2018-02-02 21:36 ` [PATCH 4/4] xfs_scrub: log operational messages when interactive Darrick J. Wong
2018-02-05 16:50 ` [PATCH 5/4] xfs_io: fix copy_file_range symbol name collision Darrick J. Wong
2018-02-05 17:21   ` Eric Sandeen

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=59ab35b1-95fc-1797-8fec-83027343f6bb@redhat.com \
    --to=sandeen@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@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 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).