W dniu 04.06.2012 22:04, Jean-Pierre André wrote:
> Hi,
> 
> Bogdan wrote:
>> Hello everybody.
>>
>>   I've prepared a small patch for utils.c and ntfswipe.c:
>> - in utils.c, checking for allocated blocks is fixed to pre-fetch
>> data on the first run,
>>    
> 
> -       if ((lcn < bmplcn)
> +       if ((bmplcn < 0) || (lcn < bmplcn)
>             || (lcn >= (long long)(bmplcn + (sizeof(buffer) << 3)))) {
> 
> Can you explain this one ?
> 
> AFAIK lcn is always >= 0 there, and bmplcn can only be
> negative when it is == -(sizeof(buffer) << 3), so the last
> condition is true when bmplcn is negative.
> So the change does nothing.

 There are 2 issues here. The clue issue is the "(bmplcn < 0)"
condition, which makes us fill the buffer on the first run.
 The second issue is the second condition (the one you're talking
about). Yes, "-(sizeof(buffer) << 3)" makes bmplcn negative, so it
looks like this condition will always be the same as "lcn => 0". But
there is one small detail that makes the change: bmplcn is STATIC. It
holds its value between calls. The second condition checks if "lcn"
doesn't fall beyond the current buffer.

[...]

>>   Additionally, a small correction is added to the layout.h file
>> (change from floating-point constant to long long), so that there
>> are no warnings when ntfsck.c is being compiled. You can make this
>> conditional, there are autoconf tests that check for support of the
>> "long long" type in the C compiler.
>>    
> 
> Hmm, this patch is wrong :
> 
> -#define magicNTFS      const_cpu_to_le64(0x202020205346544e)   /*
> "NTFS    " */
> +#define magicNTFS      const_cpu_to_le64(0x202020205346544ll)  /*
> "NTFS    " */

 Why do you think it's wrong? I change a floating point value to a
long long.

>>   It would be nice if you could make the "list.h" header a part of
>> the public API/development package, with "NTFS_" or "ntfs_" prefixes
>> on the symbols.
>>    
> 
> Do you have a real need ? I am reluctant to change
> external names which can break existing applications.

 I'm have code that is similar to the code in ntfsprogs (also uses
lists). I don't really, really need this, I can copy the macros and
the structures. But I thought this would be easier, so the users don't
have to write their own versions.
 You wouldn't break existing applications (except ntfsprogs), because
this header file is internal to ntfsprogs.

>>   Please reply also to my e-mail address (not only to the list) when
>> replying to this mail.
>>
>>   If you can see this mail, then it means you have to subscribe to the
>> mailing list to be able to post messages (while on your website you
>> said this list is open).
> Correct.

 You could enable the sourceforge's "Patches" tracker so people like
me won't have to subscribe to mailing lists just to submit a patch
(unless discussion is required, like here, but you can always e-mail
the patch submitter on SF in such cases).

 I'll reply to the other mail later, when I correct and check
everything. Thank you for looking at my patch.

-- 
Pozdrawiam/Regards - Bogdan                     (GNU/Linux & FreeDOS)
Kurs asemblera x86 (DOS, GNU/Linux):http://rudy.mif.pg.gda.pl/~bogdro
Grupy dyskusyjne o asm:  pl.comp.lang.asm alt.pl.asm alt.pl.asm.win32
www.Xiph.org   www.TorProject.org   Soft (EN): miniurl.pl/bogdro-soft

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to