Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2013 19:22:40 +0100
From:      "Steven Hartland" <killing@multiplay.co.uk>
To:        "hiren panchasara" <hiren@FreeBSD.org>, "Glen Barber" <gjb@freebsd.org>, "Hiroki Sato" <hrs@freebsd.org>
Cc:        svn-src-head <svn-src-head@freebsd.org>, Rick Macklem <rmacklem@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, src-committers <src-committers@freebsd.org>
Subject:   Re: svn commit: r252074 - head/sys/fs/nfsclient
Message-ID:  <28B87860D4194B3DA2E6A992537142B1@multiplay.co.uk>
References:  <201306212246.r5LMkHBY070137@svn.freebsd.org><20130622042219.GC1888@glenbarber.us> <CALCpEUF__sJqEgzkx5v88c4FZTyOiKOEQuebWFJ09Bk8n-Y1jA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I thought the use of PRIu64  was frowned on?

    Regards
    Steve
----- Original Message ----- 
From: "hiren panchasara" <hiren@FreeBSD.org>
To: "Glen Barber" <gjb@freebsd.org>; "Hiroki Sato" <hrs@freebsd.org>
Cc: "Rick Macklem" <rmacklem@freebsd.org>; "src-committers" <src-committers@freebsd.org>; "svn-src-all" <svn-src-all@freebsd.org>; 
"svn-src-head" <svn-src-head@freebsd.org>
Sent: Saturday, June 22, 2013 7:16 PM
Subject: Re: svn commit: r252074 - head/sys/fs/nfsclient


>+ Hiroki
>
> Hiroki seems to have a patch fixing it.
>
> http://lists.freebsd.org/pipermail/freebsd-current/2013-June/042605.html
>
> cheers,
> Hiren
>
> On Fri, Jun 21, 2013 at 9:22 PM, Glen Barber <gjb@freebsd.org> wrote:
>> On Fri, Jun 21, 2013 at 10:46:17PM +0000, Rick Macklem wrote:
>>> Author: rmacklem
>>> Date: Fri Jun 21 22:46:16 2013
>>> New Revision: 252074
>>> URL: http://svnweb.freebsd.org/changeset/base/252074
>>>
>>> Log:
>>>   The NFSv4.1 LayoutCommit operation requires a valid offset and length.
>>>   (0, 0 is not sufficient) This patch a loop for each file layout, using
>>>   the offset, length of each file layout in a separate LayoutCommit.
>>>
>>> Modified:
>>>   head/sys/fs/nfsclient/nfs_clstate.c
>>>
>>> Modified: head/sys/fs/nfsclient/nfs_clstate.c
>>> ==============================================================================
>>> --- head/sys/fs/nfsclient/nfs_clstate.c       Fri Jun 21 22:45:03 2013        (r252073)
>>> +++ head/sys/fs/nfsclient/nfs_clstate.c       Fri Jun 21 22:46:16 2013        (r252074)
>>> @@ -5145,16 +5145,28 @@ static void
>>>  nfscl_dolayoutcommit(struct nfsmount *nmp, struct nfscllayout *lyp,
>>>      struct ucred *cred, NFSPROC_T *p)
>>>  {
>>> +     struct nfsclflayout *flp;
>>> +     uint64_t len;
>>>       int error;
>>>
>>> -     error = nfsrpc_layoutcommit(nmp, lyp->nfsly_fh, lyp->nfsly_fhlen,
>>> -         0, 0, 0, lyp->nfsly_lastbyte, &lyp->nfsly_stateid,
>>> -         NFSLAYOUT_NFSV4_1_FILES, 0, NULL, cred, p, NULL);
>>> -     if (error == NFSERR_NOTSUPP) {
>>> -             /* If the server doesn't want it, don't bother doing it. */
>>> -             NFSLOCKMNT(nmp);
>>> -             nmp->nm_state |= NFSSTA_NOLAYOUTCOMMIT;
>>> -             NFSUNLOCKMNT(nmp);
>>> +     LIST_FOREACH(flp, &lyp->nfsly_flayrw, nfsfl_list) {
>>> +             if (flp->nfsfl_off <= lyp->nfsly_lastbyte) {
>>> +                     len = flp->nfsfl_end - flp->nfsfl_off;
>>> +                     error = nfsrpc_layoutcommit(nmp, lyp->nfsly_fh,
>>> +                         lyp->nfsly_fhlen, 0, flp->nfsfl_off, len,
>>> +                         lyp->nfsly_lastbyte, &lyp->nfsly_stateid,
>>> +                         NFSLAYOUT_NFSV4_1_FILES, 0, NULL, cred, p, NULL);
>>> +                     NFSCL_DEBUG(4, "layoutcommit err=%d off=%qd len=%qd "
>>> +                         "lastbyte=%qd\n", error, flp->nfsfl_off, len,
>>> +                         lyp->nfsly_lastbyte);
>>> +                     if (error == NFSERR_NOTSUPP) {
>>> +                             /* If not supported, don't bother doing it. */
>>> +                             NFSLOCKMNT(nmp);
>>> +                             nmp->nm_state |= NFSSTA_NOLAYOUTCOMMIT;
>>> +                             NFSUNLOCKMNT(nmp);
>>> +                             break;
>>> +                     }
>>> +             }
>>>       }
>>>  }
>>>
>>
>>
>> This breaks head/.
>>
>> /src/sys/fs/nfsclient/nfs_clstate.c:5161:8: error: format specifies type 'long long' but the
>> argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat]
>>                             lyp->nfsly_lastbyte);
>>                             ^~~~~~~~~~~~~~~~~~~
>> /src/sys/fs/nfs/nfscl.h:74:11: note: expanded from macro 'NFSCL_DEBUG'
>>                         printf(__VA_ARGS__); \
>>                                ^
>> 3 errors generated.
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /obj/amd64.amd64/src/sys/LINT
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /src
>>
>> Glen
>>
> 


================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
or return the E.mail to postmaster@multiplay.co.uk.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?28B87860D4194B3DA2E6A992537142B1>