[Digikam-devel] [patch] Re: digikam and can't umount

Achim Bohnet ach at mpe.mpg.de
Thu Jan 12 02:26:47 CET 2006


On Wednesday 11 January 2006 12:19, Achim Bohnet wrote:
> Hi Kévin, Jean-Rémy,  Digikam devels
> 
> with digikam from stable one can't umount an usbdisk
> camera while digikam is running.

Hi,

this is a minimalistic patch to fix the cornercase of
unsupported file format (e.g. video files) on usb storage.

the patch is minimalistic because it fixes only one of several
leak or return statements without closing ifp (and tfp) later.

Gilles: I know you want to keep the changes to this file minimal
to make merging with upstream easier.  Can you fix all leaks in
a way that least distrubs your future merges?   Or should I just
add lots of fclose or goto in stable branch?  And you care about
a real fix in trunk?

Tom: the bug is independent of your media:/ code (I love it!) you
added and is disabled now.  The bug was just not noticed  ;)
What other open 'awkward corner cases' have you in mind
beside my awkward wish add-umount-menuitem-for-mounted-usbdisks? ;)

Achim

Index: libs/dcraw/dcraw_parse.cpp
===================================================================
--- libs/dcraw/dcraw_parse.cpp  (revision 497117)
+++ libs/dcraw/dcraw_parse.cpp  (working copy)
@@ -1255,7 +1255,8 @@
   parse_mos(0);
   parse_jpeg(0);
   if (model[0] == 0) {
-    kdDebug() << "unsupported file format." << endl;
+    kdDebug() << "dcraw_parse: unsupported file format." << endl;
+    fclose(ifp);
     return 1;
   }
   kdDebug() << "Findings for " << infile << ":" << endl;


Gilles 
> While fuser is empty, lsof found the 'bad' guys:
> 
> allee[0] ~ # lsof | grep /media/sdb1
> digikam   21856         ttt   17r      REG       8,17  1550872       2822 /media/sdb1/DCIM/101MSDCF/MOV04450.MPG
> digikam   21856         ttt   18r      REG       8,17  1287563       2824 /media/sdb1/DCIM/101MSDCF/MOV04451.MPG
> digikam   21856         ttt   19r      REG       8,17  3262195       2827 /media/sdb1/DCIM/101MSDCF/MOV04452.MPG
> digikam   21856         ttt   20r      REG       8,17   238461       2830 /media/sdb1/DCIM/101MSDCF/MOV04453.MPG
> digikam   21856         ttt   21r      REG       8,17   108814       2832 /media/sdb1/DCIM/101MSDCF/MOV04454.MPG
> allee[0] ~ # fuser /media/sdb1
> /media/sdb1:
> allee[1] ~ # lsof | grep /media/sdb1
> digikam   21856         ttt   17r      REG       8,17  1550872       2822 /media/sdb1/DCIM/101MSDCF/MOV04450.MPG
> digikam   21856         ttt   18r      REG       8,17  1287563       2824 /media/sdb1/DCIM/101MSDCF/MOV04451.MPG
> digikam   21856         ttt   19r      REG       8,17  3262195       2827 /media/sdb1/DCIM/101MSDCF/MOV04452.MPG
> digikam   21856         ttt   20r      REG       8,17   238461       2830 /media/sdb1/DCIM/101MSDCF/MOV04453.MPG
> digikam   21856         ttt   21r      REG       8,17   108814       2832 /media/sdb1/DCIM/101MSDCF/MOV04454.MPG
> 
> 
> So my guess it that the create-thumbnail-for-movies part of digikam is
> is locking the media even when the download dialog is closed.  Tom,
> Jokele Gilles et al does this make sense?
> 
> 
> Kévin, Jean-Rémy,
> 
> if you can point us to any code example show to best add
> and umount menu item to every mounted camera this
> would be great.  (anything less brute force than
> kprocess "df | -q grep /media/whatever"  && addmenuitem kprocess\
> "pumount /media/whatever" ;)
> 
> Thx,
> Achim
> -- 
>   To me vi is Zen.  To use vi is to practice zen. Every command is
>   a koan. Profound to the user, unintelligible to the uninitiated.
>   You discover truth everytime you use it.
>                                       -- reddy at lion.austin.ibm.com
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel
> 

-- 
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
                                      -- reddy at lion.austin.ibm.com


More information about the Digikam-devel mailing list