diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 22:25:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 22:25:39 -0400 |
commit | ac694dbdbc403c00e2c14d10bc7b8412cc378259 (patch) | |
tree | e37328cfbeaf43716dd5914cad9179e57e84df76 /drivers/block | |
parent | a40a1d3d0a2fd613fdec6d89d3c053268ced76ed (diff) | |
parent | 437ea90cc3afdca5229b41c6b1d38c4842756cb9 (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge Andrew's second set of patches:
- MM
- a few random fixes
- a couple of RTC leftovers
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (120 commits)
rtc/rtc-88pm80x: remove unneed devm_kfree
rtc/rtc-88pm80x: assign ret only when rtc_register_driver fails
mm: hugetlbfs: close race during teardown of hugetlbfs shared page tables
tmpfs: distribute interleave better across nodes
mm: remove redundant initialization
mm: warn if pg_data_t isn't initialized with zero
mips: zero out pg_data_t when it's allocated
memcg: gix memory accounting scalability in shrink_page_list
mm/sparse: remove index_init_lock
mm/sparse: more checks on mem_section number
mm/sparse: optimize sparse_index_alloc
memcg: add mem_cgroup_from_css() helper
memcg: further prevent OOM with too many dirty pages
memcg: prevent OOM with too many dirty pages
mm: mmu_notifier: fix freed page still mapped in secondary MMU
mm: memcg: only check anon swapin page charges for swap cache
mm: memcg: only check swap cache pages for repeated charging
mm: memcg: split swapin charge function into private and public part
mm: memcg: remove needless !mm fixup to init_mm when charging
mm: memcg: remove unneeded shmem charge type
...
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nbd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 061427a75d37..76bc96fd01c8 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -154,6 +154,7 @@ static int sock_xmit(struct nbd_device *nbd, int send, void *buf, int size, | |||
154 | struct msghdr msg; | 154 | struct msghdr msg; |
155 | struct kvec iov; | 155 | struct kvec iov; |
156 | sigset_t blocked, oldset; | 156 | sigset_t blocked, oldset; |
157 | unsigned long pflags = current->flags; | ||
157 | 158 | ||
158 | if (unlikely(!sock)) { | 159 | if (unlikely(!sock)) { |
159 | dev_err(disk_to_dev(nbd->disk), | 160 | dev_err(disk_to_dev(nbd->disk), |
@@ -167,8 +168,9 @@ static int sock_xmit(struct nbd_device *nbd, int send, void *buf, int size, | |||
167 | siginitsetinv(&blocked, sigmask(SIGKILL)); | 168 | siginitsetinv(&blocked, sigmask(SIGKILL)); |
168 | sigprocmask(SIG_SETMASK, &blocked, &oldset); | 169 | sigprocmask(SIG_SETMASK, &blocked, &oldset); |
169 | 170 | ||
171 | current->flags |= PF_MEMALLOC; | ||
170 | do { | 172 | do { |
171 | sock->sk->sk_allocation = GFP_NOIO; | 173 | sock->sk->sk_allocation = GFP_NOIO | __GFP_MEMALLOC; |
172 | iov.iov_base = buf; | 174 | iov.iov_base = buf; |
173 | iov.iov_len = size; | 175 | iov.iov_len = size; |
174 | msg.msg_name = NULL; | 176 | msg.msg_name = NULL; |
@@ -214,6 +216,7 @@ static int sock_xmit(struct nbd_device *nbd, int send, void *buf, int size, | |||
214 | } while (size > 0); | 216 | } while (size > 0); |
215 | 217 | ||
216 | sigprocmask(SIG_SETMASK, &oldset, NULL); | 218 | sigprocmask(SIG_SETMASK, &oldset, NULL); |
219 | tsk_restore_flags(current, pflags, PF_MEMALLOC); | ||
217 | 220 | ||
218 | return result; | 221 | return result; |
219 | } | 222 | } |
@@ -405,6 +408,7 @@ static int nbd_do_it(struct nbd_device *nbd) | |||
405 | 408 | ||
406 | BUG_ON(nbd->magic != NBD_MAGIC); | 409 | BUG_ON(nbd->magic != NBD_MAGIC); |
407 | 410 | ||
411 | sk_set_memalloc(nbd->sock->sk); | ||
408 | nbd->pid = task_pid_nr(current); | 412 | nbd->pid = task_pid_nr(current); |
409 | ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr); | 413 | ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr); |
410 | if (ret) { | 414 | if (ret) { |