linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A possible fsnotify bug.
@ 2010-11-14  5:14 Alexey Zaytsev
       [not found] ` <AANLkTik_MigWuCfJyj282GZOyEDURtJt9pgSKP7d=77_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Zaytsev @ 2010-11-14  5:14 UTC (permalink / raw)
  To: Eric Paris, linux-fsdevel

Hi.

Have not tested, but this code in fs/nfsd/vfs.c looks suspicious:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=fs/nfsd/vfs.c;h=184938fcff04d5dff712b8bee01f5d7e41bb20ad;hb=HEAD#l1032

1032         host_err = vfs_writev(file, (struct iovec __user *)vec,
vlen, &offset);
1033         set_fs(oldfs);
1034         if (host_err < 0)
1035                 goto out_nfserr;
1036         *cnt = host_err;
1037         nfsdstats.io_write += host_err;
1038         fsnotify_modify(file);

fsnotify_modify() is called from vfs_writev() -> do_readv_writev(),
and the users are probably getting duplicate events, right?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A possible fsnotify bug.
       [not found] ` <AANLkTik_MigWuCfJyj282GZOyEDURtJt9pgSKP7d=77_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-11-14 23:15   ` Alexey Zaytsev
  2010-11-15 17:24     ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Zaytsev @ 2010-11-14 23:15 UTC (permalink / raw)
  To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
  Cc: Eric Paris, J. Bruce Fields, Neil Brown,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA, Robert Love

Confirmed, the user is getting duplicate notifications. Looks like
this has been working this way since the original inotify patch. Is
this the intended behavior?

On Sun, Nov 14, 2010 at 08:14, Alexey Zaytsev <alexey.zaytsev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi.
>
> Have not tested, but this code in fs/nfsd/vfs.c looks suspicious:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=fs/nfsd/vfs.c;h=184938fcff04d5dff712b8bee01f5d7e41bb20ad;hb=HEAD#l1032
>
> 1032         host_err = vfs_writev(file, (struct iovec __user *)vec,
> vlen, &offset);
> 1033         set_fs(oldfs);
> 1034         if (host_err < 0)
> 1035                 goto out_nfserr;
> 1036         *cnt = host_err;
> 1037         nfsdstats.io_write += host_err;
> 1038         fsnotify_modify(file);
>
> fsnotify_modify() is called from vfs_writev() -> do_readv_writev(),
> and the users are probably getting duplicate events, right?
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A possible fsnotify bug.
  2010-11-14 23:15   ` Alexey Zaytsev
@ 2010-11-15 17:24     ` J. Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2010-11-15 17:24 UTC (permalink / raw)
  To: Alexey Zaytsev
  Cc: linux-fsdevel, Eric Paris, Neil Brown, linux-nfs, Robert Love

On Mon, Nov 15, 2010 at 02:15:55AM +0300, Alexey Zaytsev wrote:
> Confirmed, the user is getting duplicate notifications. Looks like
> this has been working this way since the original inotify patch. Is
> this the intended behavior?

I can't think of any reason for the nfsd code to be diong the
notification itself--looks like just a mistake to me.

--b.

> 
> On Sun, Nov 14, 2010 at 08:14, Alexey Zaytsev <alexey.zaytsev@gmail.com> wrote:
> > Hi.
> >
> > Have not tested, but this code in fs/nfsd/vfs.c looks suspicious:
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=fs/nfsd/vfs.c;h=184938fcff04d5dff712b8bee01f5d7e41bb20ad;hb=HEAD#l1032
> >
> > 1032         host_err = vfs_writev(file, (struct iovec __user *)vec,
> > vlen, &offset);
> > 1033         set_fs(oldfs);
> > 1034         if (host_err < 0)
> > 1035                 goto out_nfserr;
> > 1036         *cnt = host_err;
> > 1037         nfsdstats.io_write += host_err;
> > 1038         fsnotify_modify(file);
> >
> > fsnotify_modify() is called from vfs_writev() -> do_readv_writev(),
> > and the users are probably getting duplicate events, right?
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-15 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-14  5:14 A possible fsnotify bug Alexey Zaytsev
     [not found] ` <AANLkTik_MigWuCfJyj282GZOyEDURtJt9pgSKP7d=77_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-14 23:15   ` Alexey Zaytsev
2010-11-15 17:24     ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).