From: Michał Nazarewicz on
On Wed, 21 Apr 2010 17:38:22 +0200, <fabien.chouteau(a)gmail.com> wrote:
> From: Fabien Chouteau <fabien.chouteau(a)barco.com>
>
>
> Signed-off-by: Fabien Chouteau <fabien.chouteau(a)barco.com>

Commit message missing, in both patches. It should contain some
details on what the patch does and how this can be used.

> @@ -2412,7 +2451,6 @@ static void fsg_disable(struct usb_function *f)
> raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
> }
>-

This is not important, but if you are going to resend the patch,
how about not deleting this line?

> /*-------------------------------------------------------------------------*/
> static void handle_exception(struct fsg_common *common)
> @@ -2641,7 +2679,7 @@ static int fsg_main_thread(void *common_)
> /* Write permission is checked per LUN in store_*() functions. */
> static DEVICE_ATTR(ro, 0644, fsg_show_ro, fsg_store_ro);
> static DEVICE_ATTR(file, 0644, fsg_show_file, fsg_store_file);
> -
> +static DEVICE_ATTR(ejected, 0444, fsg_show_ejected, NULL);

Same here.

Otherwise, both patches look fine to me.

--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał "mina86" Nazarewicz (o o)
ooo +---[mina86(a)mina86.com]---[mina86(a)jabber.org]---ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Greg KH on
On Wed, Apr 21, 2010 at 06:43:44PM +0200, Michał Nazarewicz wrote:
> On Wed, 21 Apr 2010 17:38:22 +0200, <fabien.chouteau(a)gmail.com> wrote:
> >From: Fabien Chouteau <fabien.chouteau(a)barco.com>
> >
> >
> >Signed-off-by: Fabien Chouteau <fabien.chouteau(a)barco.com>
>
> Commit message missing, in both patches. It should contain some
> details on what the patch does and how this can be used.

I agree, that is a requirement. Please resubmit these with some
description of what is happening.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Chouteau Fabien on
On Fri, Apr 23, 2010 at 5:36 PM, Alan Stern <stern(a)rowland.harvard.edu> wrote:
>
> On Fri, 23 Apr 2010, Chouteau Fabien wrote:
>
> > > > + * When a LUN receive an "eject" SCSI request (Start/Stop Unit),
> > > > + * if the LUN is removable, the backing file is released to simulate
> > > > + * ejection.
> > > > + * The "eject" state of a LUN is available in the "ejected" file of the
> > > > + * LUN's sysfs directory (see above). The "eject" state is only updated
> > > > + * by SCSI request, not by user ejection.
> > >
> > > What's the reason for that? �With a real removable device, like a CD
> > > player, it doesn't make any difference whether the medium was ejected
> > > because of a SCSI command or because I pressed the "eject" button.
> > >
> > > I just don't see any point in keeping track of the two actions
> > > separately, since they end up having the same final result.
> > >
> >
> > By user ejection, I mean send an empty line in the "file" sysfs entry.
> > The Start/Stop request is an action from the USB host side, user
> > ejection is from the USB device side, for me it's two different
> > events.
> > Maybe my comment is not clear about this point.
>
> No; it's clear enough and I understood what you meant. �It's true that
> they are two different events, but they have the same end result.
>
> > I use a FAT disk image as LUN file, users can put some files in the
> > "fake" disk and then eject it. When I get the ejected signal, I mount
> > the disk image on loop device and perform operations on the user's
> > files.
> > So I want to know when users eject the disk and only when users do.
> >
> > I still can use the LUN ejection from device side to disable the mass
> > storage device, and in this case I don't want to mount the disk and
> > search for user's files.
>
> Why not? �Isn't it possible that the user put some files there before
> the device-side eject happened?
>
> What happens if the user and the device both try to eject the medium at
> approximately the same time? �Which event occurs first will be purely
> random chance. �That means there's a 50% probability you will end up
> doing the wrong thing.
>
> No, I think you need to do the same thing whenever an eject occurs, or
> else find a better criterion for deciding what to do.

You're right, I can do the same thing for both ejection.
I'm going to resend the patch without the "eject" sysfs entry.


--
Fabien Chouteau
EPITA GISTR 2010
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Chouteau Fabien on
On Mon, Apr 26, 2010 at 12:34 PM, <fabien.chouteau(a)gmail.com> wrote:
>
> From: Fabien Chouteau <fabien.chouteau(a)barco.com>
>
> This patch adds handling of the "Start/Stop Unit" SCSI request
> to simulate media ejection.

Any comments on the last version?



--
Fabien Chouteau
EPITA GISTR 2010
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Michał Nazarewicz on
> On Mon, Apr 26, 2010 at 12:34 PM, <fabien.chouteau(a)gmail.com> wrote:
>> This patch adds handling of the "Start/Stop Unit" SCSI request
>> to simulate media ejection.

On Tue, 27 Apr 2010 14:19:42 +0200, Chouteau Fabien <fabien.chouteau(a)gmail.com> wrote:
> Any comments on the last version?

As far as I'm concerned, it looks fine.

--
Best regards, _ _
| Humble Liege of Serenely Enlightened Majesty of o' \,=./ `o
| Computer Science, Michał "mina86" Nazarewicz (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/