]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: simplify refcounting for oplock breaks
authorJeff Layton <jlayton@redhat.com>
Tue, 26 Jul 2011 16:20:17 +0000 (12:20 -0400)
committerSteve French <sfrench@us.ibm.com>
Sun, 31 Jul 2011 21:21:20 +0000 (21:21 +0000)
commitf47b487af89bad12ad28fcb8e13c69a9abf981af
treeb199a039df4aacd26224302b7c29193171e4d444
parent57b130241f8b532f17bb1dd25597e6c9123f1948
cifs: simplify refcounting for oplock breaks

Currently, we take a sb->s_active reference and a cifsFileInfo reference
when an oplock break workqueue job is queued. This is unnecessary and
more complicated than it needs to be. Also as Al points out,
deactivate_super has non-trivial locking implications so it's best to
avoid that if we can.

Instead, just cancel any pending oplock breaks for this filehandle
synchronously in cifsFileInfo_put after taking it off the lists.
That should ensure that this job doesn't outlive the structures it
depends on.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/cifsglob.h
fs/cifs/file.c
fs/cifs/misc.c