]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
pnfs-obj: Fix __r4w_get_page when offset is beyond i_size
authorBoaz Harrosh <bharrosh@panasas.com>
Thu, 7 Jun 2012 23:02:30 +0000 (02:02 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 25 Jul 2012 03:11:31 +0000 (04:11 +0100)
commit4060625241ce9236e16174b45fbb452bb5d846d1
tree137856a96430b2aa31fd482a55c5fb42f0049150
parent0ab51e8bbf2466f4426142773be0095ad0137848
pnfs-obj: Fix __r4w_get_page when offset is beyond i_size

commit c999ff68029ebd0f56ccae75444f640f6d5a27d2 upstream.

It is very common for the end of the file to be unaligned on
stripe size. But since we know it's beyond file's end then
the XOR should be preformed with all zeros.

Old code used to just read zeros out of the OSD devices, which is a great
waist. But what scares me more about this situation is that, we now have
pages attached to the file's mapping that are beyond i_size. I don't
like the kind of bugs this calls for.

Fix both birds, by returning a global zero_page, if offset is beyond
i_size.

TODO:
Change the API to ->__r4w_get_page() so a NULL can be
returned without being considered as error, since XOR API
treats NULL entries as zero_pages.

[Bug since 3.2. Should apply the same way to all Kernels since]
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
[bwh: Backported to 3.2: adjust for lack of wdata->header]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/objlayout/objio_osd.c