diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-07-26 12:20:17 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-07-31 17:21:20 -0400 |
commit | ad635942c869ad8fc9af270d4998c42b4e978b32 (patch) | |
tree | b199a039df4aacd26224302b7c29193171e4d444 /fs/cifs/misc.c | |
parent | 5980fc966bb347801f3fcc39a2ef2a1e14fbf8cb (diff) |
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>
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r-- | fs/cifs/misc.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 03a1f491d39b..7c1693392598 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -585,15 +585,8 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
585 | 585 | ||
586 | cifs_set_oplock_level(pCifsInode, | 586 | cifs_set_oplock_level(pCifsInode, |
587 | pSMB->OplockLevel ? OPLOCK_READ : 0); | 587 | pSMB->OplockLevel ? OPLOCK_READ : 0); |
588 | /* | 588 | queue_work(system_nrt_wq, |
589 | * cifs_oplock_break_put() can't be called | 589 | &netfile->oplock_break); |
590 | * from here. Get reference after queueing | ||
591 | * succeeded. cifs_oplock_break() will | ||
592 | * synchronize using cifs_file_list_lock. | ||
593 | */ | ||
594 | if (queue_work(system_nrt_wq, | ||
595 | &netfile->oplock_break)) | ||
596 | cifs_oplock_break_get(netfile); | ||
597 | netfile->oplock_break_cancelled = false; | 590 | netfile->oplock_break_cancelled = false; |
598 | 591 | ||
599 | spin_unlock(&cifs_file_list_lock); | 592 | spin_unlock(&cifs_file_list_lock); |