AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:mail.onstor.net
NSV:
SSH:
R:<ed.kwan@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@exch1.onstor.net/INBOX	0	2779531E7C760D4491C96305019FEEB52AD1CA7BC9@exch1.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 12 Jun 2009 16:07:06 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Ed Kwan <ed.kwan@onstor.com>
Subject: Re: please review code change for TED 26926 "nfs cache show nsm
 records" dumps core
Message-ID: <20090612160706.7b5c03a4@ripper.onstor.net>
In-Reply-To: <2779531E7C760D4491C96305019FEEB52AD1CA7BC9@exch1.onstor.net>
References: <2779531E7C760D4491C96305019FEEB52AD1CA7BC9@exch1.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Fri, 12 Jun 2009 15:34:35 -0700 Ed Kwan <ed.kwan@onstor.com> wrote:

> [edk@edk-linux ssc-nfxsh]$ p4 info
> User name: edk
> Client name: edk-dev
> Client host: edk-linux.onstor.net
> Client root: /homes/edk/p4/dev
> Current directory: /homes/edk/p4/dev/nfx-tree/code/ssc-nfxsh
> Client address: 10.0.0.137:53892
> Server address: liszt.onstor.net:1717
> Server root: /p4data/p4root
> Server date: 2009/06/12 15:32:59 -0700 PDT
> Server version: P4D/LINUX26X86_64/2007.2/122958 (2007/05/23)
> Server license: ONStor 40 users (support expired 2009/05/20)
> 
> [edk@edk-linux ssc-nfxsh]$ p4 describe 32642
> Change 32642 by edk@edk-dev on 2009/06/12 15:31:32 *pending*
> 
>         For TED 26926 "nfs cache show nsm records" dumps core
>         Changed the calculation of the record length to match
> ncp_rec_size_nsm(). Reviewed by ??
> 
> Affected files ...
> 
> ... //depot/dev/nfx-tree/code/ssc-nfxsh/cmd_nfs.c#23 edit
> 
> [edk@edk-linux ssc-nfxsh]$ p4 diff -dc ...
> ==== //depot/dev/nfx-tree/code/ssc-nfxsh/cmd_nfs.c#23
> - /homes/edk/p4/dev/nfx-tree/code/ssc-nfxsh/cmd_nfs.c ====
> *************** *** 3484,3490 ****
>                   struct nsm_disk_record *rec = ptr;
>                   char buf[2048];
>                   struct in_addr a;
> !                 int recLen = (rec->name_len + 8 +
> sizeof(rec->callback) + 7) & ~7; a.s_addr =
> rec->callback.nme_private[0]; memcpy(buf, rec->name, rec->name_len);
>                   buf[rec->name_len] = 0;
> --- 3484,3492 ----
>                   struct nsm_disk_record *rec = ptr;
>                   char buf[2048];
>                   struct in_addr a;
> !                 int recLen = ((4 + 4 + sizeof(rec->callback) +
> !                                rec->name_len + 1) +
> !                               7) & ~7;
>                   a.s_addr = rec->callback.nme_private[0];
>                   memcpy(buf, rec->name, rec->name_len);
>                   buf[rec->name_len] = 0;
> 







= Change 32642 by edk@edk-dev on 2009/06/12 15:31:32 *pending*
=
=	For TED 26926 "nfs cache show nsm records" dumps core
=	Changed the calculation of the record length to match
ncp_rec_size_nsm(). =	Reviewed by ??

nfx-tree/code/ssc-nfxsh/cmd_nfs.c

     I don't think this code is save-able.  You're going to have to
     do something like ncp_rec_size_nsm().  just a macro should do it.
     What if the structure changes?  This code will go sideways in
     an instant.  There should be an "offsetof" or "container" macro
     laying around that you can use.



