diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2012-10-28 08:30:15 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-12-12 00:21:27 -0500 |
commit | 1a42faae4967bc0cdb7cefcfbfca45f7d0b10360 (patch) | |
tree | f30b52f6336a2f0bcd685eddabf9501f097aef58 /xlators/storage/posix/src/posix.h | |
parent | 6ae820dc4c79f34a5c381b752a80c4b0169b60bb (diff) |
storage/posix: Make rchecksum O_DIRECT friendly
Problem:
When posix-aio is enabled to perform aio fd is set with O_DIRECT
whenever possible in read, writev fops. Rchecksum does not take
this into account. If either offset/size/memory-buf passed to
pread in rchecksum fop is not aligned, pread fails with EINVAL.
Fix:
Before doing pread necessary O_DIRECT manipulation is done when
aio is enabled. Memory buffer passed to pread is now page-aligned.
Test:
1) Create replica volume with aio enabled.
2) dd if=/dev/urandom of=a bs=1M count=1
3) kill one of the bricks in the replica pair
4) dd if=/dev/urandom of=a bs=1M count=1
5) bring back the brick. Self-heal succeeds after the change.
The test above checks both rchecksum, writev fops that were
changed in this patch.
Change-Id: I5126e20ca1d6aeb71d4d66d14de277729fc8e89f
BUG: 866459
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/156
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/1880
Diffstat (limited to 'xlators/storage/posix/src/posix.h')
-rw-r--r-- | xlators/storage/posix/src/posix.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h index eccd4d85fa7..f4e1b0a1015 100644 --- a/xlators/storage/posix/src/posix.h +++ b/xlators/storage/posix/src/posix.h @@ -168,4 +168,8 @@ int posix_fd_ctx_get (fd_t *fd, xlator_t *this, struct posix_fd **pfd); void posix_fill_ino_from_gfid (xlator_t *this, struct iatt *buf); gf_boolean_t posix_special_xattr (char **pattern, char *key); + +void +__posix_fd_set_odirect (fd_t *fd, struct posix_fd *pfd, int opflags, + off_t offset, size_t size); #endif /* _POSIX_H */ |