If we fail to open the mountpoint during phase 1 of scrub, don't bother
trying to close the file descriptor since it's silly to spray error
messages about that.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
if (ctx->datadev)
disk_close(ctx->datadev);
fshandle_destroy();
- error = close(ctx->mnt_fd);
- if (error)
- str_errno(ctx, _("closing mountpoint fd"));
+ if (ctx->mnt_fd >= 0) {
+ error = close(ctx->mnt_fd);
+ if (error)
+ str_errno(ctx, _("closing mountpoint fd"));
+ }
fs_table_destroy();
return true;