diff options
author | Kevin Hilman <khilman@linaro.org> | 2015-08-10 10:28:03 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-08-10 10:28:03 -0700 |
commit | cec285f5fdb58cc760d0b882f9a2d94d7ff21a8a (patch) | |
tree | 88e8a378175c9661554305eee42498a500d4d6dc /fs/ext4/inode.c | |
parent | 524b802ce0de62e8accdd0efd08b5db7766f13c3 (diff) | |
parent | e9fd6ddcabf8695329f2462d3ece5a8442f2a8cf (diff) |
Merge tag 'v3.18.20' into linux-linaro-lsk-v3.18
Linux 3.18.20
* tag 'v3.18.20': (52 commits)
Linux 3.18.20
blk-mq: fix CPU hotplug handling
SCSI: add 1024 max sectors black list flag
Fix firmware loader uevent buffer NULL pointer dereference
arm64: Don't report clear pmds and puds as huge
9p: don't leave a half-initialized inode sitting around
9p: forgetting to cancel request on interrupted zero-copy RPC
NFS: Fix size of NFSACL SETACL operations
watchdog: omap: assert the counter being stopped before reprogramming
of: return NUMA_NO_NODE from fallback of_node_to_nid()
USB: usbfs: allow URBs to be reaped after disconnection
dell-laptop: Fix allocating & freeing SMI buffer page
mac80211: prevent possible crypto tx tailroom corruption
security_syslog() should be called once only
__bitmap_parselist: fix bug in empty string handling
mmc: card: Fixup request missing in mmc_blk_issue_rw_rq
iser-target: Fix possible deadlock in RDMA_CM connection error
iscsi-target: Convert iscsi_thread_set usage to kthread.h
ACPICA: Tables: Fix an issue that FACS initialization is performed twice
Btrfs: fix memory leak in the extent_same ioctl
...
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 120824664d32..777f74370143 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1230,7 +1230,7 @@ static void ext4_da_page_release_reservation(struct page *page, unsigned int offset, unsigned int length) { - int to_release = 0; + int to_release = 0, contiguous_blks = 0; struct buffer_head *head, *bh; unsigned int curr_off = 0; struct inode *inode = page->mapping->host; @@ -1251,14 +1251,23 @@ static void ext4_da_page_release_reservation(struct page *page, if ((offset <= curr_off) && (buffer_delay(bh))) { to_release++; + contiguous_blks++; clear_buffer_delay(bh); + } else if (contiguous_blks) { + lblk = page->index << + (PAGE_CACHE_SHIFT - inode->i_blkbits); + lblk += (curr_off >> inode->i_blkbits) - + contiguous_blks; + ext4_es_remove_extent(inode, lblk, contiguous_blks); + contiguous_blks = 0; } curr_off = next_off; } while ((bh = bh->b_this_page) != head); - if (to_release) { + if (contiguous_blks) { lblk = page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits); - ext4_es_remove_extent(inode, lblk, to_release); + lblk += (curr_off >> inode->i_blkbits) - contiguous_blks; + ext4_es_remove_extent(inode, lblk, contiguous_blks); } /* If we have released all the blocks belonging to a cluster, then we |