Project

General

Profile

Actions

Bug #546

closed

direct i/o does not work when offset is not page-aligned

Added by Henry Chang over 13 years ago. Updated over 13 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
-
Target version:
% Done:

0%

Spent time:
Source:
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

When opening file with O_DIRECT, seeking to offset 6656 and reading 512 bytes gets wrong data.
Below is a strace log reading file on local fs:

open("/tmp/benian.img", O_RDONLY|O_DIRECT) = 3
stat("/tmp/benian.img", {st_mode=S_IFREG|0644, st_size=7168, ...}) = 0
lseek(3, 0, SEEK_END)                   = 7168
lseek(3, 0, SEEK_CUR)                   = 7168
lseek(3, 6656, SEEK_SET)                = 6656
read(3, "conectix\0\0\0\2\0\1\0\0\0\0\0\0\0\0\2\0\24c\355\337tap\0"..., 512) = 512

Below is the strace log reading file on ceph:

open("/mnt/depot0/benian.img", O_RDONLY|O_DIRECT) = 3
stat("/mnt/depot0/benian.img", {st_mode=S_IFREG|0644, st_size=7168, ...}) = 0
lseek(3, 0, SEEK_END)                   = 7168
lseek(3, 0, SEEK_CUR)                   = 7168
lseek(3, 6656, SEEK_SET)                = 6656
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512


Files

benian.img (7 KB) benian.img Henry Chang, 11/04/2010 11:04 PM
Actions #1

Updated by Henry Chang over 13 years ago

Attached is the testing file.

Actions #2

Updated by Sage Weil over 13 years ago

  • Project changed from Ceph to Linux kernel client
Actions #3

Updated by Sage Weil over 13 years ago

  • Target version set to v2.6.37
Actions #4

Updated by Sage Weil over 13 years ago

  • Priority changed from Normal to High
Actions #5

Updated by Sage Weil over 13 years ago

  • Priority changed from High to Urgent
Actions #6

Updated by Sage Weil over 13 years ago

  • Status changed from New to Resolved
  • Assignee set to Sage Weil
  • Estimated time set to 2:00 h
  • Source changed from 0 to 2

See commit:c5c6b19d4b8f5431fca05f28ae9e141045022149. Passes my tests.

Actions

Also available in: Atom PDF