[Sugar-devel] [PATCH sugar-0.84] journal scan of external media

James Cameron quozl at laptop.org
Mon Sep 6 23:03:40 EDT 2010


I've noticed that on Sugar 0.84 at least, inserting external media such
as a USB HDD, flash drive, or SD card with an entire operating system on
it is an unpleasant experience:

1.  the progress bar stutters; does not smoothly update,

2.  the progress bar may not go away, depending on whether the
filesystem contains unreadable directories, (dev.laptop.org #10140)

3.  the shell.log contains a huge amount of errors.

The stutter is caused by the overall design ... one pass through the top
level directory is made, then for each directory in that one gobject
idle task is created, and so on recursively.

On a filesystem containing Ubuntu 10.04, for instance, with 6249
directories, 48732 files, and 18317 symlinks, the number of gobject idle
tasks reaches several thousand ... each of which are serviced once
before GTK+ is permitted to do a progress bar graphics update.

The code may as well have just recursed right where it was; with this
number of idle tasks there's very little point in using idle tasks.

The failure of the progress bar to go away is addressed in one of the
attached patches.  It's just a failure to count down, caused by an idle
task throwing an exception without decrementing a counter.

A cause of the huge amount of errors is the presence of recursive
symlinks:

	/usr/bin/X11 -> .

... which causes the scan to iterate through the same directory as many
times as it can until the number of links in the path exceeds some
implementation limit.

This is addressed in the second of the attached patches.

Discussion desired.

-- 
James Cameron
http://quozl.linux.org.au/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-for-non-completion-of-scan-of-external-media-dev.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100907/555af496/attachment-0002.patch 


More information about the Sugar-devel mailing list