diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-07-03 02:20:27 +0200 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-07-12 22:55:27 +0200 |
commit | 693c241a5f6aa01417f5f4caf9f82e60e316398d (patch) | |
tree | 4d3509db621c7af934332c433e62b49bb548a60b /fs/coda/coda_int.h | |
parent | ocfs2: Zero the tail cluster when extending past i_size. (diff) | |
download | linux-693c241a5f6aa01417f5f4caf9f82e60e316398d.tar.xz linux-693c241a5f6aa01417f5f4caf9f82e60e316398d.zip |
ocfs2: No need to zero pages past i_size.
When ocfs2 fills a hole, it does so by allocating clusters. When a
cluster is larger than the write, ocfs2 must zero the portions of the
cluster outside of the write. If the clustersize is smaller than a
pagecache page, this is handled by the normal pagecache mechanisms, but
when the clustersize is larger than a page, ocfs2's write code will zero
the pages adjacent to the write. This makes sure the entire cluster is
zeroed correctly.
Currently ocfs2 behaves exactly the same when writing past i_size.
However, this means ocfs2 is writing zeroed pages for portions of a new
cluster that are beyond i_size. The page writeback code isn't expecting
this. It treats all pages past the one containing i_size as left behind
due to a previous truncate operation.
Thankfully, ocfs2 calculates the number of pages it will be working on
up front. The rest of the write code merely honors the original
calculation. We can simply trim the number of pages to only cover the
actual file data.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Cc: stable@kernel.org
Diffstat (limited to 'fs/coda/coda_int.h')
0 files changed, 0 insertions, 0 deletions