RE: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

2005-12-14 Thread Loh, Joe

 This should be fixed now, too, in CVS.  Please try the next developers
snapshot.

We just downloaded cygwin-inst-20051213.tar.bz2 and tried the snapshot.
Problem with lseek(SEEK_END) is resolve and the result returned
corresponded with the /proc/partitions.

Thank you.

Joe

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

2005-12-07 Thread Corinna Vinschen
On Dec  6 13:45, Loh, Joe wrote:
 Hello folks,
 We have created the following test case to illustrate the behavior that
 we observed.  Hopefully someone out there can shed some light into the
 subject matter.This behavior is observed running CYGWIN_NT-5.2
 P3PANDA 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin.

Have you tried this with the latest snashot from
http://cygwin.com/snapshots ?


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

2005-12-07 Thread Loh, Joe
 Have you tried this with the latest snashot from
http://cygwin.com/snapshots ?


 Corinna

We just installed the cygwin-inst-20051207.tar.bz2 snapshot.  The output
in //proc/partitions is the same as the Cygwin Kernel 1.5.18.  However,
the lseek(SEEK_END) no longer works.  When I rerun the C program it
gave the following error. I even recompiled with the new snapshot just
to make sure, still the same error.  I have also attached the strace
output for the lseekend.

$ ./lseekend.exe /dev/sda
lseek: Invalid argument

Here's the output from the snapshot:

major minor  #blocks  name

8 0  78124095 sda
8 1  15358108 sda1
8 2104422 sda2
8 3  16386300 sda3

Strace for lseekend:

**
Program name: C:\cygwin\home\Administrator\lseekend.exe (pid 3220, ppid
1)
App version:  1005.19, api: 0.147
DLL version:  1005.19, api: 0.147
DLL build:20051207 10:34:08SNP
OS version:   Windows NT-5.2
Heap size:402653184
Date/Time:2005-12-07 11:15:23
**
   74 592 [main] lseekend 3220 set_myself: myself-dwProcessId 3220
   63 655 [main] lseekend 3220 time: 1133975723 = time (0)
  5481203 [main] lseekend 3220 environ_init: GetEnvironmentStrings
returned 0x2458B8 - =C:=C:\cygwin\bin
  1861389 [main] lseekend 3220 environ_init: 0x420238:
!C:=C:\cygwin\bin
   791468 [main] lseekend 3220 environ_init: 0x420250:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
   771545 [main] lseekend 3220 environ_init: 0x420288:
APPDATA=C:\Documents and Settings\Administrator\Application Data
   801625 [main] lseekend 3220 environ_init: 0x4202D0:
CLIENTNAME=Console
   771702 [main] lseekend 3220 environ_init: 0x4202E8:
CLUSTERLOG=C:\WINDOWS\Cluster\cluster.log
   781780 [main] lseekend 3220 environ_init: 0x420318:
COLORFGBG=0;default;15
   771857 [main] lseekend 3220 environ_init: 0x420338:
COLORTERM=rxvt-xpm
   781935 [main] lseekend 3220 environ_init: 0x420350:
COMMONPROGRAMFILES=C:\Program Files\Common Files
   782013 [main] lseekend 3220 environ_init: 0x420388:
COMPUTERNAME=P3PANDA
   772090 [main] lseekend 3220 environ_init: 0x4203A8:
COMSPEC=C:\WINDOWS\system32\cmd.exe
   782168 [main] lseekend 3220 environ_init: 0x4203D0:
CVS_RSH=/bin/ssh
   802248 [main] lseekend 3220 set_file_api_mode: File APIs set to
OEM
   402288 [main] lseekend 3220 parse_options: codepage (called func)
   772365 [main] lseekend 3220 parse_options: tty 1001
   782443 [main] lseekend 3220 parse_options: binmode 65536
   772520 [main] lseekend 3220 parse_options: title 1
   762596 [main] lseekend 3220 parse_options: returning
   412637 [main] lseekend 3220 environ_init: 0x4203E8:
CYGWIN=codepage:oem tty binmode title
   772714 [main] lseekend 3220 environ_init: 0x420460: DISPLAY=:0
   772791 [main] lseekend 3220 environ_init: 0x420470: EDITOR=vi
   772868 [main] lseekend 3220 environ_init: 0x420480:
FP_NO_HOST_CHECK=NO
   812949 [main] lseekend 3220 getwinenv: can't set native for HOME=
since no environ yet
   803029 [main] lseekend 3220 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\home\Administrator, no-keep-rel,
no-add-slash)
   483077 [main] lseekend 3220 normalize_win32_path:
C:\cygwin\home\Administrator = normalize_win32_path
(C:\cygwin\home\Administrator)
   493126 [main] lseekend 3220 mount_info::conv_to_posix_path:
/home/Administrator = conv_to_posix_path (C:\cygwin\home\Administrator)
  1143240 [main] lseekend 3220 win_env::add_cache: posix
/home/Administrator
   413281 [main] lseekend 3220 win_env::add_cache: native
HOME=C:\cygwin\home\Administrator
   413322 [main] lseekend 3220 posify: env var converted to
HOME=/home/Administrator
   773399 [main] lseekend 3220 environ_init: 0x4204C0:
HOME=/home/Administrator
   773476 [main] lseekend 3220 environ_init: 0x420498: HOMEDRIVE=C:
   773553 [main] lseekend 3220 environ_init: 0x420610:
HOMEPATH=\Documents and Settings\Administrator
   783631 [main] lseekend 3220 environ_init: 0x420648:
HOSTNAME=P3PANDA
   773708 [main] lseekend 3220 environ_init: 0x420660:
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
   793787 [main] lseekend 3220 environ_init: 0x420698:
LOGONSERVER=\\P3PANDA
   773864 [main] lseekend 3220 environ_init: 0x4206B8:
MAKE_MODE=unix
   783942 [main] lseekend 3220 environ_init: 0x4206D0:
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man
   784020 [main] lseekend 3220 environ_init: 0x420718:
NUMBER_OF_PROCESSORS=2
   774097 [main] lseekend 3220 environ_init: 0x420738:
OLDPWD=/usr/bin
   774174 [main] lseekend 3220 environ_init: 0x420750: OS=Windows_NT
  1344308 [main] lseekend 3220 getwinenv: can't set native for PATH=
since no environ yet
   504358 [main] lseekend 3220 normalize_posix_path: src .
   484406 [main] lseekend 3220 mount_info::conv_to_posix_path:

Re: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

2005-12-07 Thread Corinna Vinschen
On Dec  7 11:17, Loh, Joe wrote:
 We just installed the cygwin-inst-20051207.tar.bz2 snapshot.  The output
 in //proc/partitions is the same as the Cygwin Kernel 1.5.18.  However,
 the lseek(SEEK_END) no longer works.  When I rerun the C program it
 gave the following error. I even recompiled with the new snapshot just
 to make sure, still the same error.  I have also attached the strace
 output for the lseekend.
 
 $ ./lseekend.exe /dev/sda
 lseek: Invalid argument

Ouch.  Thanks for the report.  I have fixed a buggy condition which
only allowed to seek to 1 byte below EOM in CVS.  You should see the
change in the next developers snapshot.

 Here's the output from the snapshot:
 
 major minor  #blocks  name
 
 8 0  78124095 sda
 8 1  15358108 sda1
 8 2104422 sda2
 8 3  16386300 sda3

The reason that /proc/partition contains wrong information is that
the /proc/partition information uses an old, deprecated IOCTL call
to evaluate the disk size by # of cylinders, # of tracks per sektor,
etc.  I didn't fix that so far but it's not overly complicated, so
stay tuned.


Thanks again,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

2005-12-07 Thread Corinna Vinschen
On Dec  7 19:12, Corinna Vinschen wrote:
 On Dec  7 11:17, Loh, Joe wrote:
  major minor  #blocks  name
  
  8 0  78124095 sda
  8 1  15358108 sda1
  8 2104422 sda2
  8 3  16386300 sda3
 
 The reason that /proc/partition contains wrong information is that
 the /proc/partition information uses an old, deprecated IOCTL call
 to evaluate the disk size by # of cylinders, # of tracks per sektor,
 etc.  I didn't fix that so far but it's not overly complicated, so
 stay tuned.

This should be fixed now, too, in CVS.  Please try the next developers
snapshot.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

2005-12-07 Thread Loh, Joe
 On Dec  7 11:17, Loh, Joe wrote:
 We just installed the cygwin-inst-20051207.tar.bz2 snapshot.  The 
 output in //proc/partitions is the same as the Cygwin Kernel 1.5.18.

 However, the lseek(SEEK_END) no longer works.  When I rerun the C 
 program it gave the following error. I even recompiled with the new 
 snapshot just to make sure, still the same error.  I have also 
 attached the strace output for the lseekend.
 
 $ ./lseekend.exe /dev/sda
 lseek: Invalid argument

 Ouch.  Thanks for the report.  I have fixed a buggy condition which
only allowed to seek to 1 byte below EOM in CVS.  You should see the
change in the next developers snapshot.

 Here's the output from the snapshot:
 
 major minor  #blocks  name
 
 8 0  78124095 sda
 8 1  15358108 sda1
 8 2104422 sda2
 8 3  16386300 sda3

 The reason that /proc/partition contains wrong information is that the
/proc/partition information uses an  old, deprecated IOCTL call to
evaluate the disk size by # of cylinders, # of tracks per sektor, etc.
I didn't fix that so far but it's not overly complicated, so stay tuned.

Thank you.  We will give the next snapshot a try.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Size difference reported by /proc/partitions and lseek(SEEK_END) on block device

2005-12-06 Thread Loh, Joe
Hello folks,
We have created the following test case to illustrate the behavior that
we observed.  Hopefully someone out there can shed some light into the
subject matter.This behavior is observed running CYGWIN_NT-5.2
P3PANDA 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin.

The block device size is different between the values reported in
/proc/partitions and lseek(SEEK_END).  We have included a small 'C'
program that simply uses lseek to size the block device.  Is this
expected of?  If so, what accounts for the descrepancy?  We have another
system with a 40G drives that doesn't show such discrepancy.  We are
able to address the LBA beyond the range reported in /proc/partitions
using 'dd'.  So, it's definitely addressable, but we ran into yet a
different issue as we approach the end of the block device using 'dd'.
We have open a different thread to address the 'dd' isssue under Error
reported dd'ing close of end of block device with skip

Here's the 'C' program listing:

#define _FILE_OFFSET_BITS 64

#include sys/types.h
#include sys/stat.h
#include fcntl.h
#include unistd.h
#include stdio.h

int main (int argc, char* const argv[])
{
  int vFd;
  off_t vSz;
  if (argv[1] == NULL) {
printf(SYNTAX: %s DEVICE\n,argv[0]);
exit(1);
  }

  vFd = open(argv[1],O_RDONLY);
  if (vFd  0) {
perror(open);
exit(1);
  }
  vSz = lseek(vFd, (off_t)0, SEEK_END);
  if (vSz  0) {
perror(lseek);
exit(1);
  }
  close(vFd);
  printf(%s size: %llu bytes (%llu of 1024-bytes
blocks)\n,argv[1],vSz,(vSz/1024));
  exit(0);
}

Comparing the results from the lseek sizing with the /proc/partitions.
We got the following results:

$ cat /proc/partitions
major minor  #blocks  name

8 0  78124095 sda
8 1  15358108 sda1
8 2104422 sda2
8 3  16386300 sda3

Results from lseek(SEEK_END):

/dev/sda size: 800 bytes (78125000 of 1024-bytes blocks)

Here's the output from strace:

**
Program name: C:\cygwin\home\Administrator\lseekend.exe (pid 376, ppid
1)
App version:  1005.18, api: 0.132
DLL version:  1005.18, api: 0.132
DLL build:2005-07-02 20:30
OS version:   Windows NT-5.2
Heap size:402653184
Date/Time:2005-12-06 13:41:02
**
   63 451 [main] lseekend 376 set_myself: myself-dwProcessId 376
   72 523 [main] lseekend 376 time: 1133898062 = time (0)
  7951318 [main] lseekend 376 environ_init: 0x420238:
!C:=C:\cygwin\bin
  1531471 [main] lseekend 376 environ_init: 0x420250:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
   981569 [main] lseekend 376 environ_init: 0x420288:
APPDATA=C:\Documents and Settings\Administrator\Application Data
   951664 [main] lseekend 376 environ_init: 0x4202D0:
CLIENTNAME=ASTOR
   911755 [main] lseekend 376 environ_init: 0x4202E8:
CLUSTERLOG=C:\WINDOWS\Cluster\cluster.log
   921847 [main] lseekend 376 environ_init: 0x420318:
COLORFGBG=0;default;15
   951942 [main] lseekend 376 environ_init: 0x420338:
COLORTERM=rxvt-xpm
   932035 [main] lseekend 376 environ_init: 0x420350:
COMMONPROGRAMFILES=C:\Program Files\Common Files
   942129 [main] lseekend 376 environ_init: 0x420388:
COMPUTERNAME=P3PANDA
   942223 [main] lseekend 376 environ_init: 0x4203A8:
COMSPEC=C:\WINDOWS\system32\cmd.exe
   942317 [main] lseekend 376 environ_init: 0x4203D0:
CVS_RSH=/bin/ssh
   952412 [main] lseekend 376 set_file_api_mode: File APIs set to
OEM
   622474 [main] lseekend 376 parse_options: codepage (called func)
   942568 [main] lseekend 376 parse_options: tty 1001
   932661 [main] lseekend 376 parse_options: binmode 65536
   952756 [main] lseekend 376 parse_options: title 1
   912847 [main] lseekend 376 parse_options: returning
   482895 [main] lseekend 376 environ_init: 0x4203E8:
CYGWIN=codepage:oem tty binmode title
   952990 [main] lseekend 376 environ_init: 0x420460: DISPLAY=:0
   923082 [main] lseekend 376 environ_init: 0x420470: EDITOR=vi
   963178 [main] lseekend 376 environ_init: 0x420480:
FP_NO_HOST_CHECK=NO
  1003278 [main] lseekend 376 getwinenv: can't set native for HOME=
since no environ yet
  1043382 [main] lseekend 376 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\cygwin\home\Administrator, no-keep-rel,
no-add-slash)
   593441 [main] lseekend 376 normalize_win32_path:
C:\cygwin\home\Administrator = normalize_win32_path
(C:\cygwin\home\Administrator)
   613502 [main] lseekend 376 mount_info::conv_to_posix_path:
/home/Administrator = conv_to_posix_path (C:\cygwin\home\Administrator)
  1433645 [main] lseekend 376 win_env::add_cache: posix
/home/Administrator
   473692 [main] lseekend 376 win_env::add_cache: native
HOME=C:\cygwin\home\Administrator
   493741 [main] lseekend 376 posify: env var converted to
HOME=/home/Administrator
   973838 [main] lseekend 376 environ_init: 0x4204C0:
HOME=/home/Administrator
   94