From: Allison Collins <allison.henderson@oracle.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/4] xfs_restore: check return value
Date: Mon, 6 May 2019 17:11:30 -0700 [thread overview]
Message-ID: <038696eb-a0ff-ea34-ebfb-4372ca38873c@oracle.com> (raw)
In-Reply-To: <155085405082.5141.12150949924461780415.stgit@magnolia>
Looks ok.
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
On 2/22/19 9:47 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Check the return value of the unlink call when creating a new file.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> restore/dirattr.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>
> diff --git a/restore/dirattr.c b/restore/dirattr.c
> index 0fb2877..4257a1b 100644
> --- a/restore/dirattr.c
> +++ b/restore/dirattr.c
> @@ -67,7 +67,9 @@ create_filled_file(
> int fd;
> int ret;
>
> - (void)unlink(pathname);
> + ret = unlink(pathname);
> + if (ret && errno != ENOENT)
> + return ret;
>
> fd = open(pathname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
> if (fd < 0)
>
next prev parent reply other threads:[~2019-05-07 0:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 16:47 [PATCH 0/4] xfsdump: update to use fallocate Darrick J. Wong
2019-02-22 16:47 ` [PATCH 1/4] xfs_restore: refactor open-coded file creation code Darrick J. Wong
2019-02-22 19:20 ` Andre Noll
2019-02-22 19:28 ` Darrick J. Wong
2019-02-22 19:55 ` Andre Noll
2019-05-07 0:11 ` Allison Collins
2019-05-20 21:05 ` Darrick J. Wong
2019-02-22 16:47 ` [PATCH 2/4] xfs_restore: check return value Darrick J. Wong
2019-05-07 0:11 ` Allison Collins [this message]
2019-02-22 16:47 ` [PATCH 3/4] xfs_restore: fix unsupported ioctl detection Darrick J. Wong
2019-05-07 0:11 ` Allison Collins
2019-02-22 16:47 ` [PATCH 4/4] xfs_restore: support fallocate when reserving space for a file Darrick J. Wong
2019-05-07 0:11 ` Allison Collins
2019-05-06 18:24 ` [PATCH 0/4] xfsdump: update to use fallocate Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2019-08-20 20:21 Darrick J. Wong
2019-08-20 20:21 ` [PATCH 2/4] xfs_restore: check return value Darrick J. Wong
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=038696eb-a0ff-ea34-ebfb-4372ca38873c@oracle.com \
--to=allison.henderson@oracle.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