Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108077
b: refs/heads/master
c: 93d0ec8
h: refs/heads/master
i:
  108075: 358b491
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Aug 4, 2008
1 parent 3e8cd96 commit df2f811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66b8bd3c405389213de1d6ba6c2565990f62004f
refs/heads/master: 93d0ec851820688ef5b21a84e7460d3cf405f5c5
15 changes: 6 additions & 9 deletions trunk/fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,9 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)

current->flags |= PF_MEMALLOC;
cFYI(1, ("Demultiplex PID: %d", task_pid_nr(current)));
write_lock(&GlobalSMBSeslock);
atomic_inc(&tcpSesAllocCount);
length = tcpSesAllocCount.counter;
write_unlock(&GlobalSMBSeslock);
if (length > 1)

length = atomic_inc_return(&tcpSesAllocCount);
if (length > 1)
mempool_resize(cifs_req_poolp, length + cifs_min_rcv,
GFP_KERNEL);

Expand Down Expand Up @@ -745,14 +743,11 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
coming home not much else we can do but free the memory */
}

write_lock(&GlobalSMBSeslock);
atomic_dec(&tcpSesAllocCount);
length = tcpSesAllocCount.counter;

/* last chance to mark ses pointers invalid
if there are any pointing to this (e.g
if a crazy root user tried to kill cifsd
kernel thread explicitly this might happen) */
write_lock(&GlobalSMBSeslock);
list_for_each(tmp, &GlobalSMBSessionList) {
ses = list_entry(tmp, struct cifsSesInfo,
cifsSessionList);
Expand All @@ -763,6 +758,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)

kfree(server->hostname);
kfree(server);

length = atomic_dec_return(&tcpSesAllocCount);
if (length > 0)
mempool_resize(cifs_req_poolp, length + cifs_min_rcv,
GFP_KERNEL);
Expand Down

0 comments on commit df2f811

Please sign in to comment.