* Linux-2.6.31-rc8 inotify hangs samba clients
@ 2009-08-28 16:13 Jeff Chua
2009-08-28 16:20 ` Eric Paris
2009-08-28 21:37 ` walt
0 siblings, 2 replies; 6+ messages in thread
From: Jeff Chua @ 2009-08-28 16:13 UTC (permalink / raw)
To: Eric W. Biederman, Eric Paris; +Cc: Linux Kernel, Linus Torvalds
The first part of commit 0db501bd0610ee0c0aca84d927f90bcccd09e2bd hangs
WinXP clients browsing Linux samba folders ... trying to add a
terminating byte to name_len. Reverting this solves the problem.
The second part of adding zeros is fine.
If we don't revert here, then Samba 3.3.7 will have to change to work with
Linux 2.6.31-rc8, and perhaps other codes as well.
Thanks,
Jeff
commit 0db501bd0610ee0c0aca84d927f90bcccd09e2bd
Author: Eric W. Biederman <ebiederm@xmission.com>
Date: Thu Aug 27 03:20:04 2009 -0700
inotify: Ensure we alwasy write the terminating NULL.
Before the rewrite copy_event_to_user always wrote a terqminating '\0'
byte to user space after the filename. Since the rewrite that
terminating byte was skipped if your filename is exactly a multiple of
event_size. Ouch!
So add one byte to name_size before we round up.
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index ce1f582..0e781bc 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -199,8 +196,10 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
inotify_free_event_priv(fsn_priv);
}
- /* round up event->name_len so it is a multiple of event_size */
- name_len = roundup(event->name_len, event_size);
+ /* round up event->name_len so it is a multiple of event_size
+ * plus an extra byte for the terminating '\0'.
+ */
+ name_len = roundup(event->name_len, event_size) + 1;
inotify_event.len = name_len;
inotify_event.mask = inotify_mask_to_arg(event->mask);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Linux-2.6.31-rc8 inotify hangs samba clients
2009-08-28 16:13 Linux-2.6.31-rc8 inotify hangs samba clients Jeff Chua
@ 2009-08-28 16:20 ` Eric Paris
2009-08-28 16:30 ` Jeff Chua
2009-08-28 21:37 ` walt
1 sibling, 1 reply; 6+ messages in thread
From: Eric Paris @ 2009-08-28 16:20 UTC (permalink / raw)
To: Jeff Chua; +Cc: Eric W. Biederman, Linux Kernel, Linus Torvalds
On Sat, 2009-08-29 at 00:13 +0800, Jeff Chua wrote:
>
> The first part of commit 0db501bd0610ee0c0aca84d927f90bcccd09e2bd hangs
> WinXP clients browsing Linux samba folders ... trying to add a
> terminating byte to name_len. Reverting this solves the problem.
>
> The second part of adding zeros is fine.
>
> If we don't revert here, then Samba 3.3.7 will have to change to work with
> Linux 2.6.31-rc8, and perhaps other codes as well.
Deffinitly not Samba's fault. I should have 2 patches to fix inotify
at:
http://git.infradead.org/users/eparis/notify.git/shortlog/refs/heads/for-linus
-Eric
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux-2.6.31-rc8 inotify hangs samba clients
2009-08-28 16:20 ` Eric Paris
@ 2009-08-28 16:30 ` Jeff Chua
2009-08-29 5:48 ` Linus Torvalds
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Chua @ 2009-08-28 16:30 UTC (permalink / raw)
To: Eric Paris; +Cc: Eric W. Biederman, Linux Kernel, Linus Torvalds
On Sat, Aug 29, 2009 at 12:20 AM, Eric Paris<eparis@redhat.com> wrote:
> Deffinitly not Samba's fault. I should have 2 patches to fix inotify
> at:
>
> http://git.infradead.org/users/eparis/notify.git/shortlog/refs/heads/for-linus
Eric, didn't expect instantaneous response as I was sending out the
wrong patch and had to correct it.
Thanks again for the pointer and fixes. Will wait to pull from Linus's git.
Jeff.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux-2.6.31-rc8 inotify hangs samba clients
2009-08-28 16:13 Linux-2.6.31-rc8 inotify hangs samba clients Jeff Chua
2009-08-28 16:20 ` Eric Paris
@ 2009-08-28 21:37 ` walt
1 sibling, 0 replies; 6+ messages in thread
From: walt @ 2009-08-28 21:37 UTC (permalink / raw)
To: linux-kernel
On 08/28/2009 09:13 AM, Jeff Chua wrote:
>
>
> The first part of commit 0db501bd0610ee0c0aca84d927f90bcccd09e2bd hangs
> WinXP clients browsing Linux samba folders ... trying to add a
> terminating byte to name_len. Reverting this solves the problem.
As another data point, the same commit also prevents udev from creating
the /dev/vboxdrv device when the vboxdrv kernel module gets loaded.
Haven't tried Eric's patches yet, but I'm betting the problem will be
cured. Thanks for the quick fix, Eric.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux-2.6.31-rc8 inotify hangs samba clients
2009-08-28 16:30 ` Jeff Chua
@ 2009-08-29 5:48 ` Linus Torvalds
2009-08-30 0:36 ` Jeff Chua
0 siblings, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2009-08-29 5:48 UTC (permalink / raw)
To: Jeff Chua; +Cc: Eric Paris, Eric W. Biederman, Linux Kernel
On Sat, 29 Aug 2009, Jeff Chua wrote:
>
> Thanks again for the pointer and fixes. Will wait to pull from Linus's
> git.
Ok, I've merged the inotify things (along with a few others changes).
Please do give it a good test. I'm going to be online only to a _very_
limited degree (four-tank dive day tomorrow! Yeehaa), so I really hope
that this solves it all.
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux-2.6.31-rc8 inotify hangs samba clients
2009-08-29 5:48 ` Linus Torvalds
@ 2009-08-30 0:36 ` Jeff Chua
0 siblings, 0 replies; 6+ messages in thread
From: Jeff Chua @ 2009-08-30 0:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Eric Paris, Eric W. Biederman, Linux Kernel
On Sat, Aug 29, 2009 at 1:48 PM, Linus
Torvalds<torvalds@linux-foundation.org> wrote:
> On Sat, 29 Aug 2009, Jeff Chua wrote:
>>
>> Thanks again for the pointer and fixes. Will wait to pull from Linus's
>> git.
>
> Ok, I've merged the inotify things (along with a few others changes).
> Please do give it a good test. I'm going to be online only to a _very_
> limited degree (four-tank dive day tomorrow! Yeehaa), so I really hope
> that this solves it all.
Looks solved. Seems faster than before "introducing the bad fix".
Have a great dive!
Thanks,
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-08-30 0:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-28 16:13 Linux-2.6.31-rc8 inotify hangs samba clients Jeff Chua
2009-08-28 16:20 ` Eric Paris
2009-08-28 16:30 ` Jeff Chua
2009-08-29 5:48 ` Linus Torvalds
2009-08-30 0:36 ` Jeff Chua
2009-08-28 21:37 ` walt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox