diff mbox series

[v6,03/11] hw/usb: don't set IN_ISDIR for inotify watch in MTP driver

Message ID 20181019133835.16494-4-berrange@redhat.com (mailing list archive)
State New, archived
Headers show
Series Add a standard authorization framework | expand

Commit Message

Daniel P. Berrangé Oct. 19, 2018, 1:38 p.m. UTC
IN_ISDIR is not a bit that one can request when registering a
watch with inotify_add_watch. Rather it is a bit that is set
automatically when reading events from the kernel.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 hw/usb/dev-mtp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Marc-André Lureau Nov. 7, 2018, 6:10 p.m. UTC | #1
On Fri, Oct 19, 2018 at 5:40 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> IN_ISDIR is not a bit that one can request when registering a
> watch with inotify_add_watch. Rather it is a bit that is set
> automatically when reading events from the kernel.
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  hw/usb/dev-mtp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
> index 00a3691bae..f026419e47 100644
> --- a/hw/usb/dev-mtp.c
> +++ b/hw/usb/dev-mtp.c
> @@ -642,8 +642,7 @@ static void usb_mtp_inotify_cleanup(MTPState *s)
>
>  static int usb_mtp_add_watch(int inotifyfd, char *path)
>  {
> -    uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY |
> -        IN_ISDIR;
> +    uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY;
>
>      return inotify_add_watch(inotifyfd, path, mask);
>  }
> --
> 2.17.2
>
>
diff mbox series

Patch

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 00a3691bae..f026419e47 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -642,8 +642,7 @@  static void usb_mtp_inotify_cleanup(MTPState *s)
 
 static int usb_mtp_add_watch(int inotifyfd, char *path)
 {
-    uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY |
-        IN_ISDIR;
+    uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY;
 
     return inotify_add_watch(inotifyfd, path, mask);
 }