Hi,
> > > > changes to ... ntfsresize.
> > > Please don't. Not as it stands.
> > But you didn't even see it :)))
> But I have seen the rest of your code.
Your problem is basically listed in the ntfsresize section of the
TODO.ntfsprogs file, what section I wrote 17 months ago:
http://linux-ntfs.bkbits.net:8080/ntfsprogs-devel/anno/TODO.ntfsprogs@1.10?nav=index.html|src/
High priority:
- support fragmented volumes -- WIP
Medium priority:
- easy usage by partitioning tools -- WIP
- move useful things to libntfs
....
WIP means "work in progress". Apparently, for you, the medium priority is
the high and the high is not (so) important for you. In short our
priorities are different. Nothing wrong with that.
If you have other issues, let me know.
> > Counting the command line parsing errors
>
> What? I do "err++", just out of convenience. I don't actually use the
> value for anything. It might be useful to someone some day. I don't
> break at that point because that gives you the ability to find all the
> errors on the command line, not just the first.
Usually not. After the first parser error the others are probably bogus.
One example to demonstrate this is e.g. when you're compiling a C program.
Miss a ; and you get a bunch of errors. Fixing just the first one fixes all
the "others". Many software parsed grammers are like that.
> > is a waste of time (to implement and maintain).
>
> Again, what? I wrote the original ntfs getopt code. To cut, paste and
> tweak it is trivial. What are you suggesting?
I'm suggesting when you find an error during command line options parsing
and it makes no sense to continue then return with error. Don't
overcomplicate issues. Keep it simple, stupid. The best code is the no
code. If no code then no time wasted to implement, test, debug, maintain,
it also gives the possible best performance, no need to document, etc.
> > I don't think so. At least I've never planned for those I wrote.
>
> It shows. Having written software professionally for a long time, I
> have a good eye for code reuse.
You misunderstand me. Again because our priorities are different. First of
all I talk about ntfs tools I wrote (highest priority is reliability and
usefulness of the most demanded utils). Secondly the new code made the bits
reusable that were needed ... by ntfsresize. If they are still not reusable
for you, well, I can again only say it's not important for me, now.
Moreover, given several constrains, it doesn't make sense to make reusable
something what I even don't know it will work in the end. It's just a
baggage for what I don't have the time to carry.
> I should have complained earlier, but you've been writing a useful tool,
Yes, you should have, as Anton did 17 months ago for other things. I did
what he asked or I explained why I don't.
But even if you have asked 17 months ago, I'm not sure that would have
changed the priorities. However at that time it had much greater chances
than now, yes.
Today it's not so important because there is an "interface" in use by
several tools. The important now is not to break that interface and for the
future is to provide additionally a real, efficient interface by using a
shared library (being libntfs or whatever). You want the later one now but
as I told, for me, it still doesn't make sense. Read, right now I don't
have time to care about it. If one has the time, I'm very happy about it -
if it's done properly.
> But... To reuse any code from resize is a major undertaking.
I don't think so. But it's not high priority for me to take care about,
again.
> In resize you want to run chkdsk. Something a lot of other tools would
> want to do. But the code is heavily intertwined with other stuff.
When I wrote chkdsk pass 1 in ntfsresize, I didn't know it was that. It
just made a lot of sense to resize a volume only if you can exactly account
for every each clusters. I got to know only later on, this is what Windows
chkdsk does basically in pass one.
And I wrote in my earlier email, why it's "intertwined" with other things
(performance, less user annoyance).
> > Not for ntfsresize. I plan ntfsresize to be only a very short reference
> > impementation how to use the resize functionality when the core
> > functionality will be moved to the library.
>
> Oh great. You'll have to rewrite it from scratch.
Definitely not. You overreact the issue.
> > ntfsresize, as a standalone application
> > is a very fragile and inefficient interface to partitioning programs.
>
> But that's the only option you've given them. Will you have the time to
> rewrite it?
If one wanted resize in a library then she/he could do it in hours.
> But you must ask yourself, "could this be useful to someone else?". And
> then code it accordingly. That's what's missing in your code.
It's far not that simple. You must ask a lof of additional questions and
make a decision what fits your priorities best. Our priorities are
different, so don't wonder I don't do what you want.
> > and apparently you test with NT4 what almost nobody uses anymore:
>
> Yes. I do most of my work against NT4. It's convenient to have a
> version of Windows that runs in 16MB of memory (in vmware).
>
> 99% of NTFS hasn't changed since then, so for what we're doing it's an
99% is not 100%. If something in that 1% hits then 95% of the Windows users
data are effected/damaged.
> adequate test for development processes. I didn't say that I don't test
> against other versions. I have vms for NT, 2K, XP, 2K3. Happy now?
I didn't say it's wrong you test against NT4. But it's a factor that must
be considered.
> > So far there were less than 10 such requests compared to the several
> > _orders_ bigger "please support fragmented volumes".
>
> You didn't think that defrag would be better as a separate tool?
Resize and defrag is not the same. What they have in common is they move
data. But for _different_ purposes.
There is a picture in people (probably based on the old norton defrag or
whatever) that defrag means, all data is moved to the beginning of the
volume, they're allocated on a continuous place, etc. Well, no or not
anymore (in real, never meant).
Resize needs to _relocate_ data from the supposed to be unfreed space.
Actually if it can't allocate a continuous space for the data to be
relocated, it will even _fragment_ a file. Its job is resizing, not
defragmenting.
People who want to resize, don't want to wait long for a defragmentation.
In fact they don't want to wait at all. Today many of them defragments,
just to figure out the next day that it didn't work so well as they
expected. Or it made things even worse.
No, I was never interested in NTFS defragmentation and of course I've never
thought ntfsresize must defragment the volume. If I phrased like that I
just did because people asked that way and it's also easier to explain.
None of the users are really interested in the low level details and
indeed, none of them should.
However it turned out, some commercial defragmenters do a poor job. So it
would be really interesting just to demonstrate, that it can be done
better. That's also not a high priority for me, I'd be very glad to see if
you (or anybody else) would do it. So yes, a separate ntfsdefrag utility
would be nice.
> Speaking of which, where's the source to "ntfsmeta"? I've seen you give
> out the binary plenty of times.
Yes, I pointed people to it when need arose to investigate user issues.
I also asked you several times if you want the source but your only answer
was so far: anybody could write it before breakfast.
I have only the binary at hand but I must have the source on one of the
backups (moves, new computers, etc). I'll hunt for it and put somewhere or
send if you want. Anyway, some of the fields are printed incorrectly and I
wanted to fix it for a while.
> > It makes sure when something would go unexpected, ntfsresize quits
> > immediately. No even cleanup!
>
> Hmm...
You cut out the explanation and now reading the above makes a different
impression. So again: ntfsresize changes metadata under itself. If, in
cases, it tried to cleanup then the cleanup parts in the library could
revert part of a consistent change that would make the volume overall
inconsistent or unrecoverable.
So no cleanup above means, the volume stays always consistent or
recoverable while trying to cleanup could end up in a disaster considering
users' data (well, not really but I bored people already long enough, it's
time to vanish).
Szaka
|