diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 16:15:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 16:15:14 -0400 |
commit | dddec01eb8e2b56267b37a6f9f0997a64b4e0b2a (patch) | |
tree | b6d8bfbce9abd105384b9d116499afbe306b9c22 /fs/splice.c | |
parent | 7daf705f362e349983e92037a198b8821db198af (diff) | |
parent | 32502b8413a77b54b9e19809404109590c32dfb7 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: (37 commits)
splice: fix generic_file_splice_read() race with page invalidation
ramfs: enable splice write
drivers/block/pktcdvd.c: avoid useless memset
cdrom: revert commit 22a9189 (cdrom: use kmalloced buffers instead of buffers on stack)
scsi: sr avoids useless buffer allocation
block: blk_rq_map_kern uses the bounce buffers for stack buffers
block: add blk_queue_update_dma_pad
DAC960: push down BKL
pktcdvd: push BKL down into driver
paride: push ioctl down into driver
block: use get_unaligned_* helpers
block: extend queue_flag bitops
block: request_module(): use format string
Add bvec_merge_data to handle stacked devices and ->merge_bvec()
block: integrity flags can't use bit ops on unsigned short
cmdfilter: extend default read filter
sg: fix odd style (extra parenthesis) introduced by cmd filter patch
block: add bounce support to blk_rq_map_user_iov
cfq-iosched: get rid of enable_idle being unused warning
allow userspace to modify scsi command filter on per device basis
...
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/splice.c b/fs/splice.c index aa5f6f60b305..399442179d89 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -379,13 +379,22 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
379 | lock_page(page); | 379 | lock_page(page); |
380 | 380 | ||
381 | /* | 381 | /* |
382 | * page was truncated, stop here. if this isn't the | 382 | * Page was truncated, or invalidated by the |
383 | * first page, we'll just complete what we already | 383 | * filesystem. Redo the find/create, but this time the |
384 | * added | 384 | * page is kept locked, so there's no chance of another |
385 | * race with truncate/invalidate. | ||
385 | */ | 386 | */ |
386 | if (!page->mapping) { | 387 | if (!page->mapping) { |
387 | unlock_page(page); | 388 | unlock_page(page); |
388 | break; | 389 | page = find_or_create_page(mapping, index, |
390 | mapping_gfp_mask(mapping)); | ||
391 | |||
392 | if (!page) { | ||
393 | error = -ENOMEM; | ||
394 | break; | ||
395 | } | ||
396 | page_cache_release(pages[page_nr]); | ||
397 | pages[page_nr] = page; | ||
389 | } | 398 | } |
390 | /* | 399 | /* |
391 | * page was already under io and is now done, great | 400 | * page was already under io and is now done, great |