Re: [TEST] NTFS patch

From: Jean-Sébastien Pédron (jspedron_at_club-internet.fr)
Date: 12/13/04

  • Next message: Jeff Roberson: "Re: cvs commit: src/sys/kern sched_ule.c (fwd)"
    Date: Mon, 13 Dec 2004 17:07:31 +0100
    To: Poul-Henning Kamp <phk@phk.freebsd.dk>
    
    
    

    Poul-Henning Kamp wrote:
    > Here is a combined patch for the two problems that's been
    > reported against NTFS after my mount changes.
    >
    > Please test & report.

    With mmap(2), it doesn't panic() anymore, but the content of a file
    copied with cp(1) is wrong.

    Here is a small test case:

    ----------------
    # mount
    [...]
    /dev/ad2s1 on /mnt/ntfs (ntfs, local, read-only)

    # cat /mnt/ntfs/printenv.pl
    #!c:/Perl/bin/Perl.exe
    ##
    ## printenv -- demo CGI program which just prints its environment
    ##

    print "Content-type: text/plain\n\n";
    foreach $var (sort(keys(%ENV))) {
         $val = $ENV{$var};
         $val =~ s|\n|\\n|g;
         $val =~ s|"|\\"|g;
         print "${var}=\"${val}\"\n";
    }

    # cp /mnt/ntfs/printenv.pl .

    # xxd -l 64 printenv.pl
    0000000: eb52 904e 5446 5320 2020 2000 0201 0000 .R.NTFS .....
    0000010: 0000 0000 00f8 0000 3f00 ff00 3f00 0000 ........?...?...
    0000020: 0000 0000 8000 8000 9920 0600 0000 0000 ......... ......
    0000030: 2000 0000 0000 0000 4c10 0300 0000 0000 .......L.......

    # xxd -l 64 /dev/ad2s1
    0000000: eb52 904e 5446 5320 2020 2000 0201 0000 .R.NTFS .....
    0000010: 0000 0000 00f8 0000 3f00 ff00 3f00 0000 ........?...?...
    0000020: 0000 0000 8000 8000 9920 0600 0000 0000 ......... ......
    0000030: 2000 0000 0000 0000 4c10 0300 0000 0000 .......L.......
    ----------------

    This is with today's CVS. The NTFS file system was prepared under
    Windows 2000 SP4.

    In this example, the perl script is ok on the file system, but mmap(2)
    return data from he beginning of the file system, not the file.

     From sys/fs/ntfs/ntfs_vnops.c, ntfs_bmap():

       if (ap->a_bop != NULL)
         *ap->a_bop = &ntmp->ntm_devvp->v_bufobj;
       if (ap->a_bnp != NULL)
         *ap->a_bnp = ap->a_bn;

    The logical block number isn't converted (because it expects
    ntfs_strategy() to be called), and bstrategy() will call directly the
    device strategy function with the wrong block number.

    Am I the only one to see this behaviour ?

    Jean-Seb

    
    



  • Next message: Jeff Roberson: "Re: cvs commit: src/sys/kern sched_ule.c (fwd)"

    Relevant Pages

    • Re: [TEST] NTFS patch
      ... >> reported against NTFS after my mount changes. ... The NTFS file system was prepared under ... > The logical block number isn't converted (because it expects ...
      (freebsd-current)
    • Re: [TEST] NTFS patch
      ... Poul-Henning Kamp wrote: ... > reported against NTFS after my mount changes. ... > Please test & report. ...
      (freebsd-current)
    • Re: [TEST] NTFS patch
      ... > Here is a combined patch for the two problems that's been ... > reported against NTFS after my mount changes. ... > Please test & report. ...
      (freebsd-current)
    • Re: XP Less Secure than 98 for Sharing Files
      ... >folders & shares such that I don't have to bother with individual ... and requires NTFS; ... >> can't formally scan for malware, ... recovery and non-automated file system repair. ...
      (microsoft.public.windowsxp.security_admin)
    • Re: Windows XP Pro
      ... NTFS and is compatible with both. ... The young man who put the Windows XP Pro on her system ... >>> installed Windows XP Pro as a FAT 32 file system. ... >> - Open ONE copy of Internet Explorer. ...
      (microsoft.public.windowsxp.configuration_manage)