digikam and can't umount

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

digikam and can't umount

Bugzilla from ach@mpe.mpg.de
Hi Kévin, Jean-Rémy,  Digikam devels

with digikam from stable one can't umount an usbdisk
camera while digikam is running.

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.
                                      -- [hidden email]
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: digikam and can't umount

Gilles Caulier
Le Mercredi 11 Janvier 2006 12:19, Achim Bohnet a écrit :

> Hi Kévin, Jean-Rémy,  Digikam devels
>
> with digikam from stable one can't umount an usbdisk
> camera while digikam is running.
>
> 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?
>

camera gui do not take thumbnails from movies files. There is no code (only
JPEG and RAW) ! Are you sure to talk about USB camera gui ?


--
Gilles Caulier
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: digikam and can't umount

Bugzilla from ach@mpe.mpg.de
On Wednesday 11 January 2006 12:32, Gilles Caulier wrote:

> Le Mercredi 11 Janvier 2006 12:19, Achim Bohnet a écrit :
> > Hi Kévin, Jean-Rémy,  Digikam devels
> >
> > with digikam from stable one can't umount an usbdisk
> > camera while digikam is running.
> >
> > 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?
> >
>
> camera gui do not take thumbnails from movies files. There is no code (only
> JPEG and RAW) ! Are you sure to talk about USB camera gui ?

Hi Gilles,

oh, no, really bad guess (and how lazy) of mine :( I never scoll down,
usually just download all. And yes, usbdisk of Sony DSC-W12 camera.

Nevertheless, something of digikam keeps those files as lsof
output shows.  What it is no idea.

When I start the camera -> usbdisd (that does automounting now too)
I get the download dialog.  After image thumbs are loaded,
I close the dialog without downloading anything.
Now:
        pumount /media/usbdisk
and
        'Savely remove' in konqueror media:/

fails and lsof gives output above.

When I exit digikam, both methods to umount the camera work
immediately again.

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.
                                      -- [hidden email]
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: digikam and can't umount

Bugzilla from ervin@kde.org
In reply to this post by Bugzilla from ach@mpe.mpg.de
Le Mercredi 11 Janvier 2006 12:19, Achim Bohnet a écrit :
> 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" ;)

Well, you don't need to be brute like this. ;-)

You have two choices IMHO:
1) Call kio_media_mounthelper (using KProcess). That's definitely the easiest
way to do it.
2) Reuse the konq_popupmenu, which is available in libkonq, this way you'll
get automatically the relevant actions for free. That might be a nice way to
be future proof, if a few more servicemenus are added you'll automatically
display them too.

Regards.
--
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[patch] Re: digikam and can't umount

Bugzilla from ach@mpe.mpg.de
In reply to this post by Bugzilla from ach@mpe.mpg.de
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.
>                                       -- [hidden email]
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> 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.
                                      -- [hidden email]
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: [patch] Re: digikam and can't umount

Gilles Caulier
Le Jeudi 12 Janvier 2006 02:26, Achim Bohnet a écrit :

> 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;
>

Damned !!! and i have checked this part and found this problem using valgrind
when i have completed dcraw_parse.cpp implementation in the past... but I
have forget to fix it. All my appologies !

Fixed in trunk and stable. Thanks for this report !

Gilles
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: [patch] Re: digikam and can't umount

Tom Albers-2
In reply to this post by Bugzilla from ach@mpe.mpg.de
Achim Bohnet schreef:
> 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? ;)

Well, nobody has tested it....

Tom
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: [patch] Re: digikam and can't umount

Bugzilla from ach@mpe.mpg.de
On Thursday 12 January 2006 10:28, Tom Albers wrote:
> Achim Bohnet schreef:
> > 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? ;)
>
> Well, nobody has tested it....

Hey, I did :)   Mhmm, I will enable it for the
~rc1  dapper and breezy pkgs.  Maybe we get more
feedback then ;)

FWIW minimal tested dapper pkg and source are at:

http://www.mpe.mpg.de/~ach/tmp-dapper/

I'll enable media:/ in camera and reupload later.

Achim -- fires up breezy pbuilder ...
>
> Tom
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> 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.
                                      -- [hidden email]
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel