diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-07-02 17:20:27 -0700 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-07-12 13:55:27 -0700 |
commit | 693c241a5f6aa01417f5f4caf9f82e60e316398d (patch) | |
tree | 4d3509db621c7af934332c433e62b49bb548a60b /fs/filesystems.c | |
parent | 5693486bad2bc2ac585a2c24f7e2f3964b478df9 (diff) | |
download | op-kernel-dev-693c241a5f6aa01417f5f4caf9f82e60e316398d.zip op-kernel-dev-693c241a5f6aa01417f5f4caf9f82e60e316398d.tar.gz |
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/filesystems.c')
0 files changed, 0 insertions, 0 deletions