Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320831
b: refs/heads/master
c: 7f338fe
h: refs/heads/master
i:
  320829: 30b339a
  320827: b77c0bc
  320823: a7ec6be
  320815: f32dc24
  320799: e29517c
  320767: 3d65167
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Aug 1, 2012
1 parent 1b9769c commit c7b10f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 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: 381760eadc393bcb1bb328510ad75cf13431806d
refs/heads/master: 7f338fe4540b1d0600b02314c7d885fd358e9eca
6 changes: 5 additions & 1 deletion trunk/drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ static int sock_xmit(struct nbd_device *nbd, int send, void *buf, int size,
struct msghdr msg;
struct kvec iov;
sigset_t blocked, oldset;
unsigned long pflags = current->flags;

if (unlikely(!sock)) {
dev_err(disk_to_dev(nbd->disk),
Expand All @@ -167,8 +168,9 @@ static int sock_xmit(struct nbd_device *nbd, int send, void *buf, int size,
siginitsetinv(&blocked, sigmask(SIGKILL));
sigprocmask(SIG_SETMASK, &blocked, &oldset);

current->flags |= PF_MEMALLOC;
do {
sock->sk->sk_allocation = GFP_NOIO;
sock->sk->sk_allocation = GFP_NOIO | __GFP_MEMALLOC;
iov.iov_base = buf;
iov.iov_len = size;
msg.msg_name = NULL;
Expand Down Expand Up @@ -214,6 +216,7 @@ static int sock_xmit(struct nbd_device *nbd, int send, void *buf, int size,
} while (size > 0);

sigprocmask(SIG_SETMASK, &oldset, NULL);
tsk_restore_flags(current, pflags, PF_MEMALLOC);

return result;
}
Expand Down Expand Up @@ -405,6 +408,7 @@ static int nbd_do_it(struct nbd_device *nbd)

BUG_ON(nbd->magic != NBD_MAGIC);

sk_set_memalloc(nbd->sock->sk);
nbd->pid = task_pid_nr(current);
ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr);
if (ret) {
Expand Down

0 comments on commit c7b10f0

Please sign in to comment.