xfs
[Top] [All Lists]

Re: [PATCH] Detect strto* failures based on errno.

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] Detect strto* failures based on errno.
From: Arkadiusz MiÅkiewicz <arekm@xxxxxxxx>
Date: Wed, 16 Jul 2014 09:44:07 +0200
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maven.pl; s=maven; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=vpu4L+4GgpuTCq9lyuO5hHvwJom0E5w8W2Znu0+IYOY=; b=onzkRr8kKt/DcXTTUtQDc2X7xRo58Ftdi9n/5joBkhq/qErzp8CX/46E3Tj81YN8bD TlgORdiTpQB9zpLrPPMSht5nSPKoOEL9yzq+5eB3yy5/u96wx1WY8KDk5Y/TTaBGIehL Enr20OA082tlXzCBzcz8/5HEpM4qSot3haVa8=
In-reply-to: <20140716030132.GB20518@dastard>
References: <20140713230406.GE22339@dastard> <1405324619-25515-1-git-send-email-arekm@xxxxxxxx> <20140716030132.GB20518@dastard>
User-agent: KMail/1.13.7 (Linux/3.16.0-rc5-dirty; KDE/4.13.2; x86_64; ; )
On Wednesday 16 of July 2014, Dave Chinner wrote:
> On Mon, Jul 14, 2014 at 09:56:59AM +0200, Arkadiusz MiÅkiewicz wrote:
> > Code was testing for ERANGE errno only in some places. In other places
> > it didn't do any errno checking at all.
> > 
> > Unify strto* result testing by treating any non zero errno as failure.
> > 
> > Signed-off-by: Arkadiusz MiÅkiewicz <arekm@xxxxxxxx>
> 
> This patch appears to cause xfs/071 to fail:
> 
> 
> 
>      Writing 512 bytes, offset is +0 (direct=false)
>     -pwrite64: File too large
>     +non-numeric offset argument -- <OFFSET>
>      Reading 512 bytes (direct=false)
>      read 0/512 bytes at offset <OFFSET>
>     ...
>     (Run 'diff -u tests/xfs/071.out
> /home/dave/src/xfstests-dev/results//xfs/071.out.bad'  to see the entire
> diff)
> 
> Can you have a look into this?

The test runs:
xfs_io -c 'pwrite 9223373136366403583 512' file

where 9223373136366403583 is bigger than LLONG_MAX (9223372036854775807), so

# LC_ALL=C xfs_io -c 'pwrite 9223373136366403583 512' ./x
(MYDEBUG)strerror(34): Numerical result out of range
non-numeric offset argument -- 9223373136366403583


What would be best approach to fix this - some cvtunum for unsigned long long?

> Cheers,
> 
> Dave.


-- 
Arkadiusz MiÅkiewicz, arekm / maven.pl

<Prev in Thread] Current Thread [Next in Thread>