[PATCH][RFC] fix directory listing when filesystem partially corrupted

Jean-Tiare Le Bigot jt at yadutaf.fr
Sun Aug 30 18:44:22 CEST 2015


When opening a folder on a partially corrupted filesystem, Thunar
displays an error dialog and leaves the folder content area empty.
This behavior is consistent with Nautilus.

The error message looks like:

    Failed to open directory "Toc toc toc ?".
    Error when getting information for file '/media/jean-tiare/Toc toc toc ?/.Trash-1000': Input/output error.

When listing the same directory with ls, it gracefuly fallback to
something like: (non-relevant output redacted)

    $ LC_ALL=C ls -la
    ls: cannot access .Trash-1000: Input/output error
    ls: cannot access .gnupg: Input/output error
    total 320
    drwx------  7 jean-tiare jean-tiare   4096 Aug 30 12:49 .
    drwxr-x---+ 4 root       root         4096 Aug 30 17:34 ..
    d?????????? ? ?          ?               ?            ? .Trash-1000
    d?????????? ? ?          ?               ?            ? .gnupg
    drwx------  4 jean-tiare jean-tiare   4096 Mar  2  2014 .ssh
    drwx------  2 root       root        16384 Dec 27  2012 lost+found
    drwx------  4 jean-tiare jean-tiare   4096 Jan  7  2013 profil

This patch attempts to reproduce a similar behavior by silently skipping
entries when meating a G_IO_ERROR_FAILED error so that sane entries may
be displayed.

It won't display an error message (although I'm sure why), and won't display
dummy entries either.

Also, I'm new with gobject(?) based program and obviously did something wrong
as I get warning messages in the console:

    LC_ALL=C ./thunar/thunar

    (lt-thunar:29769): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory.
    This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
    The overwriting error message was: Error when getting information for file '/media/jean-tiare/Toc toc toc ?/.gnupg': Input/output error

--
Jean-Tiare

Jean-Tiare Le Bigot (1):
  fix: list partially corrupted folder

 thunar/thunar-io-jobs.c           |  2 +-
 thunar/thunar-io-scan-directory.c | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

-- 
2.1.4



More information about the Xfce4-dev mailing list