diff mbox series

[3/4] xfs_restore: fix unsupported ioctl detection

Message ID 155085405698.5141.702624754882653044.stgit@magnolia (mailing list archive)
State Superseded, archived
Headers show
Series xfsdump: update to use fallocate | expand

Commit Message

Darrick J. Wong Feb. 22, 2019, 4:47 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Linux ioctls can return ENOTTY or EOPNOTSUPP, so filter both of them
when logging reservation failure.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 restore/dirattr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Allison Henderson May 7, 2019, 12:11 a.m. UTC | #1
Looks ok to me
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>
> 
> Linux ioctls can return ENOTTY or EOPNOTSUPP, so filter both of them
> when logging reservation failure.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>   restore/dirattr.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/restore/dirattr.c b/restore/dirattr.c
> index 4257a1b..3fa8fb6 100644
> --- a/restore/dirattr.c
> +++ b/restore/dirattr.c
> @@ -76,7 +76,7 @@ create_filled_file(
>   		return fd;
>   
>   	ret = ioctl(fd, XFS_IOC_RESVSP64, &fl);
> -	if (ret && errno != ENOTTY)
> +	if (ret && (errno != EOPNOTSUPP && errno != ENOTTY))
>   		mlog(MLOG_VERBOSE | MLOG_NOTE,
>   _("attempt to reserve %lld bytes for %s using %s failed: %s (%d)\n"),
>   				size, pathname, "XFS_IOC_RESVSP64",
>
diff mbox series

Patch

diff --git a/restore/dirattr.c b/restore/dirattr.c
index 4257a1b..3fa8fb6 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -76,7 +76,7 @@  create_filled_file(
 		return fd;
 
 	ret = ioctl(fd, XFS_IOC_RESVSP64, &fl);
-	if (ret && errno != ENOTTY)
+	if (ret && (errno != EOPNOTSUPP && errno != ENOTTY))
 		mlog(MLOG_VERBOSE | MLOG_NOTE,
 _("attempt to reserve %lld bytes for %s using %s failed: %s (%d)\n"),
 				size, pathname, "XFS_IOC_RESVSP64",