* reiser3 and O_DIRECT read @ 2005-10-07 10:13 Gorazd Golob 2005-10-07 13:29 ` Vladimir V. Saveliev 0 siblings, 1 reply; 14+ messages in thread From: Gorazd Golob @ 2005-10-07 10:13 UTC (permalink / raw) To: reiserfs-list re! Are we looking on wrong suspect - snip from code looks like this: fd = open(f, O_RDONLY | O_DIRECT, 0); and is not working for reiserfs3 filesystem? Or in other words is reiserfs3 supporting reading with O_DIRECT flag? Writing works well with 0_DIRECT on reiserfs3. Gorazd ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-07 10:13 reiser3 and O_DIRECT read Gorazd Golob @ 2005-10-07 13:29 ` Vladimir V. Saveliev 2005-10-10 10:41 ` Gorazd Golob 0 siblings, 1 reply; 14+ messages in thread From: Vladimir V. Saveliev @ 2005-10-07 13:29 UTC (permalink / raw) To: Gorazd Golob; +Cc: reiserfs-list Hello Gorazd Golob wrote: > re! > > Are we looking on wrong suspect - snip from code looks like this: > > fd = open(f, O_RDONLY | O_DIRECT, 0); > > and is not working for reiserfs3 filesystem? > reiserfs is supposed to support O_DIRECT. Please provide more details about the problem. > Or in other words is reiserfs3 supporting reading with O_DIRECT flag? > Writing works well with 0_DIRECT on reiserfs3. > > Gorazd > > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-07 13:29 ` Vladimir V. Saveliev @ 2005-10-10 10:41 ` Gorazd Golob 2005-10-10 12:22 ` Vladimir V. Saveliev 0 siblings, 1 reply; 14+ messages in thread From: Gorazd Golob @ 2005-10-10 10:41 UTC (permalink / raw) To: Vladimir V. Saveliev; +Cc: reiserfs-list Hi! >> re! >> >> Are we looking on wrong suspect - snip from code looks like this: >> >> fd = open(f, O_RDONLY | O_DIRECT, 0); >> >> and is not working for reiserfs3 filesystem? >> > > reiserfs is supposed to support O_DIRECT. Please provide more details about the > problem. > File is opened with fd = open(f, O_RDONLY | O_DIRECT, 0); After we tried to do: numRead=read(fd, buf, alignedSize - offset) numRead returns -1 errno is EINVAL (22). Without O_DIRECT works fine as said in previous mails. Write with O_DIRECT works fine. Kernel version is: Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux please let me know if you need more info. tnx, Gorazd >> Or in other words is reiserfs3 supporting reading with O_DIRECT flag? >> Writing works well with 0_DIRECT on reiserfs3. >> >> Gorazd >> >> >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-10 10:41 ` Gorazd Golob @ 2005-10-10 12:22 ` Vladimir V. Saveliev 2005-10-10 12:30 ` Gorazd Golob 0 siblings, 1 reply; 14+ messages in thread From: Vladimir V. Saveliev @ 2005-10-10 12:22 UTC (permalink / raw) To: Gorazd Golob; +Cc: reiserfs-list Hello Gorazd Golob wrote: > Hi! > >>> re! >>> >>> Are we looking on wrong suspect - snip from code looks like this: >>> >>> fd = open(f, O_RDONLY | O_DIRECT, 0); >>> >>> and is not working for reiserfs3 filesystem? >>> >> >> reiserfs is supposed to support O_DIRECT. Please provide more details >> about the >> problem. >> > > File is opened with fd = open(f, O_RDONLY | O_DIRECT, 0); > > After we tried to do: > numRead=read(fd, buf, alignedSize - offset) > > numRead returns -1 errno is EINVAL (22). > Does it work on ext2? Are you sure that file offset is properly aligned? > Without O_DIRECT works fine as said in previous mails. Write with > O_DIRECT works fine. Kernel version is: > Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) > Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux > > please let me know if you need more info. > > tnx, Gorazd > > > > > > >>> Or in other words is reiserfs3 supporting reading with O_DIRECT flag? >>> Writing works well with 0_DIRECT on reiserfs3. >>> >>> Gorazd >>> >>> >>> >> >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-10 12:22 ` Vladimir V. Saveliev @ 2005-10-10 12:30 ` Gorazd Golob 2005-10-10 13:08 ` Vladimir V. Saveliev 0 siblings, 1 reply; 14+ messages in thread From: Gorazd Golob @ 2005-10-10 12:30 UTC (permalink / raw) To: Vladimir V. Saveliev; +Cc: reiserfs-list On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: > > Does it work on ext2? Yes it work on ext2, ext3, xfs .. > Are you sure that file offset is properly aligned? Yes .. > >> Without O_DIRECT works fine as said in previous mails. Write with >> O_DIRECT works fine. Kernel version is: >> Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) >> Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux >> >> please let me know if you need more info. >> >> tnx, Gorazd >> >> >> >> >> >> >>>> Or in other words is reiserfs3 supporting reading with O_DIRECT flag? >>>> Writing works well with 0_DIRECT on reiserfs3. >>>> >>>> Gorazd >>>> >>>> >>>> >>> >>> >> >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-10 12:30 ` Gorazd Golob @ 2005-10-10 13:08 ` Vladimir V. Saveliev 2005-10-10 13:22 ` Gorazd Golob 2005-10-10 15:40 ` Gorazd Golob 0 siblings, 2 replies; 14+ messages in thread From: Vladimir V. Saveliev @ 2005-10-10 13:08 UTC (permalink / raw) To: Gorazd Golob; +Cc: reiserfs-list [-- Attachment #1: Type: text/plain, Size: 822 bytes --] Hello Gorazd Golob wrote: > > > On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: > >> >> Does it work on ext2? > Yes it work on ext2, ext3, xfs .. > >> Are you sure that file offset is properly aligned? > Yes .. > Would you please try whether the attached program works for you? > >> >>> Without O_DIRECT works fine as said in previous mails. Write with >>> O_DIRECT works fine. Kernel version is: >>> Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) >>> Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux >>> >>> please let me know if you need more info. >>> >>> tnx, Gorazd >>> >>> >>> >>> >>> >>> >>>>> Or in other words is reiserfs3 supporting reading with O_DIRECT flag? >>>>> Writing works well with 0_DIRECT on reiserfs3. >>>>> >>>>> Gorazd >>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > [-- Attachment #2: test-direct-io.c --] [-- Type: text/x-c, Size: 570 bytes --] #include <stdio.h> #include <unistd.h> #include <fcntl.h> #define O_DIRECT 040000 int main(int argc, char **argv) { int fd; size_t rd; char *buf; if (argc != 2) { printf("%s filename\n", argv[0]); return 0; } fd = open(argv[1], O_RDONLY | O_DIRECT); if (fd == -1) { perror("open failed"); return 0; } if (posix_memalign(&buf, 4096, 4096)) { perror("malloc failed"); return 0; } rd = read(fd, buf, 4096); if (rd != 4096) { perror("read failed"); return 0; } free(buf); close(fd); return 0; } ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-10 13:08 ` Vladimir V. Saveliev @ 2005-10-10 13:22 ` Gorazd Golob 2005-10-10 15:40 ` Gorazd Golob 1 sibling, 0 replies; 14+ messages in thread From: Gorazd Golob @ 2005-10-10 13:22 UTC (permalink / raw) To: Vladimir V. Saveliev; +Cc: reiserfs-list >> > Would you please try whether the attached program works for you? Looks like it works - passed to programers. Thanks! gorazd > >> >>> >>>> Without O_DIRECT works fine as said in previous mails. Write with >>>> O_DIRECT works fine. Kernel version is: >>>> Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) >>>> Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux >>>> >>>> please let me know if you need more info. >>>> >>>> tnx, Gorazd >>>> >>>> >>>> >>>> >>>> >>>> >>>>>> Or in other words is reiserfs3 supporting reading with O_DIRECT flag? >>>>>> Writing works well with 0_DIRECT on reiserfs3. >>>>>> >>>>>> Gorazd >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-10 13:08 ` Vladimir V. Saveliev 2005-10-10 13:22 ` Gorazd Golob @ 2005-10-10 15:40 ` Gorazd Golob 2005-10-11 6:10 ` Vladimir V. Saveliev 1 sibling, 1 reply; 14+ messages in thread From: Gorazd Golob @ 2005-10-10 15:40 UTC (permalink / raw) To: Vladimir V. Saveliev; +Cc: reiserfs-list It doesn't work right - your example :( Our programmers said that ssize_t type should be used instead of size_t for rd variable.. in code is: size_t rd; tnx, gorazd On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: > Hello > > Gorazd Golob wrote: >> >> >> On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: >> >>> >>> Does it work on ext2? >> Yes it work on ext2, ext3, xfs .. >> >>> Are you sure that file offset is properly aligned? >> Yes .. >> > Would you please try whether the attached program works for you? > >> >>> >>>> Without O_DIRECT works fine as said in previous mails. Write with >>>> O_DIRECT works fine. Kernel version is: >>>> Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) >>>> Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux >>>> >>>> please let me know if you need more info. >>>> >>>> tnx, Gorazd >>>> >>>> >>>> >>>> >>>> >>>> >>>>>> Or in other words is reiserfs3 supporting reading with O_DIRECT flag? >>>>>> Writing works well with 0_DIRECT on reiserfs3. >>>>>> >>>>>> Gorazd >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-10 15:40 ` Gorazd Golob @ 2005-10-11 6:10 ` Vladimir V. Saveliev 2005-10-11 6:36 ` Gorazd Golob 0 siblings, 1 reply; 14+ messages in thread From: Vladimir V. Saveliev @ 2005-10-11 6:10 UTC (permalink / raw) To: Gorazd Golob; +Cc: reiserfs-list [-- Attachment #1: Type: text/plain, Size: 1351 bytes --] Hello Gorazd Golob wrote: > > It doesn't work right - your example :( > > Our programmers said that ssize_t type should be used instead of size_t > for rd variable.. > ok, yes, I agree. But it should not change anything. Please try new version. It works fine here. How does it behave on your side? > in code is: > > size_t rd; > > > tnx, gorazd > > > On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: > >> Hello >> >> Gorazd Golob wrote: >>> >>> >>> On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: >>> >>>> >>>> Does it work on ext2? >>> Yes it work on ext2, ext3, xfs .. >>> >>>> Are you sure that file offset is properly aligned? >>> Yes .. >>> >> Would you please try whether the attached program works for you? >> >>> >>>> >>>>> Without O_DIRECT works fine as said in previous mails. Write with >>>>> O_DIRECT works fine. Kernel version is: >>>>> Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 >>>>> Intel(R) >>>>> Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux >>>>> >>>>> please let me know if you need more info. >>>>> >>>>> tnx, Gorazd >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>> Or in other words is reiserfs3 supporting reading with O_DIRECT >>>>>>> flag? >>>>>>> Writing works well with 0_DIRECT on reiserfs3. >>>>>>> >>>>>>> Gorazd >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > [-- Attachment #2: test-direct-io.c --] [-- Type: text/x-c, Size: 668 bytes --] #define _XOPEN_SOURCE 600 #include <stdio.h> #include <unistd.h> #include <malloc.h> #include <stdlib.h> #include <fcntl.h> #define O_DIRECT 040000 int main(int argc, char **argv) { int fd; ssize_t rd; char *buf; if (argc != 2) { printf("%s filename\n", argv[0]); return 0; } fd = open(argv[1], O_RDONLY | O_DIRECT); if (fd == -1) { perror("open failed"); return 0; } if (posix_memalign((void **)&buf, 4096, 4096)) { perror("malloc failed"); return 0; } rd = read(fd, buf, 4096); if (rd != 4096) { perror("read failed"); return 0; } printf("read ok\n"); free(buf); close(fd); return 0; } ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-11 6:10 ` Vladimir V. Saveliev @ 2005-10-11 6:36 ` Gorazd Golob 2005-10-11 7:30 ` Vladimir V. Saveliev 0 siblings, 1 reply; 14+ messages in thread From: Gorazd Golob @ 2005-10-11 6:36 UTC (permalink / raw) To: Vladimir V. Saveliev; +Cc: reiserfs-list ;( works ok if file is bigger than about 4000 bytes. Otherwise read failed. On Tue, 11 Oct 2005, Vladimir V. Saveliev wrote: > Hello > > Gorazd Golob wrote: >> >> It doesn't work right - your example :( >> >> Our programmers said that ssize_t type should be used instead of size_t >> for rd variable.. >> > > ok, yes, I agree. But it should not change anything. > Please try new version. It works fine here. How does it behave on your side? > >> in code is: >> >> size_t rd; >> >> >> tnx, gorazd >> >> >> On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: >> >>> Hello >>> >>> Gorazd Golob wrote: >>>> >>>> >>>> On Mon, 10 Oct 2005, Vladimir V. Saveliev wrote: >>>> >>>>> >>>>> Does it work on ext2? >>>> Yes it work on ext2, ext3, xfs .. >>>> >>>>> Are you sure that file offset is properly aligned? >>>> Yes .. >>>> >>> Would you please try whether the attached program works for you? >>> >>>> >>>>> >>>>>> Without O_DIRECT works fine as said in previous mails. Write with >>>>>> O_DIRECT works fine. Kernel version is: >>>>>> Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 >>>>>> Intel(R) >>>>>> Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux >>>>>> >>>>>> please let me know if you need more info. >>>>>> >>>>>> tnx, Gorazd >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>> Or in other words is reiserfs3 supporting reading with O_DIRECT >>>>>>>> flag? >>>>>>>> Writing works well with 0_DIRECT on reiserfs3. >>>>>>>> >>>>>>>> Gorazd >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-11 6:36 ` Gorazd Golob @ 2005-10-11 7:30 ` Vladimir V. Saveliev 2005-10-11 7:56 ` Gorazd Golob 0 siblings, 1 reply; 14+ messages in thread From: Vladimir V. Saveliev @ 2005-10-11 7:30 UTC (permalink / raw) To: Gorazd Golob; +Cc: reiserfs-list [-- Attachment #1: Type: text/plain, Size: 443 bytes --] Hello Gorazd Golob wrote: > > ;( > > works ok if file is bigger than about 4000 bytes. Otherwise read failed. > Yes, using O_DIRECT you should care about alignment to boundary of 512 bytes for address of buffer you read to, size of that buffer and offset in a file to read from. Please try this version of test program and let us know how to make it to behave differently for file in reiserfs and ext2. What is version of kernel you use? [-- Attachment #2: test-direct-io.c --] [-- Type: text/x-c, Size: 686 bytes --] #define _XOPEN_SOURCE 600 #include <stdio.h> #include <unistd.h> #include <malloc.h> #include <stdlib.h> #include <fcntl.h> #define O_DIRECT 040000 int main(int argc, char **argv) { int fd; ssize_t rd; char *buf; size_t size; if (argc != 3) { printf("%s filename nr\n", argv[0]); return 0; } fd = open(argv[1], O_RDONLY | O_DIRECT); if (fd == -1) { perror("open failed"); return 0; } size = atoi(argv[2]); if (posix_memalign((void **)&buf, 512, size)) { perror("malloc failed"); return 0; } rd = read(fd, buf, size); if (rd != size) { perror("read failed"); return 0; } free(buf); close(fd); return 0; } ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-11 7:30 ` Vladimir V. Saveliev @ 2005-10-11 7:56 ` Gorazd Golob 2005-10-11 12:06 ` Vladimir V. Saveliev 0 siblings, 1 reply; 14+ messages in thread From: Gorazd Golob @ 2005-10-11 7:56 UTC (permalink / raw) To: Vladimir V. Saveliev; +Cc: reiserfs-list Vladimir, I forgot to tell that we're using x86_64. Kernel is: Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux On Tue, 11 Oct 2005, Vladimir V. Saveliev wrote: > Hello > > Gorazd Golob wrote: >> >> ;( >> >> works ok if file is bigger than about 4000 bytes. Otherwise read failed. >> > Yes, using O_DIRECT you should care about alignment to boundary of 512 bytes for > address of buffer you read to, size of that buffer and offset in a file to read > from. > > Please try this version of test program and let us know how to make it to behave > differently for file in reiserfs and ext2. > What is version of kernel you use? > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-11 7:56 ` Gorazd Golob @ 2005-10-11 12:06 ` Vladimir V. Saveliev 2005-10-11 16:07 ` Hans Reiser 0 siblings, 1 reply; 14+ messages in thread From: Vladimir V. Saveliev @ 2005-10-11 12:06 UTC (permalink / raw) To: Gorazd Golob; +Cc: reiserfs-list Hello Gorazd Golob wrote: > > Vladimir, > > I forgot to tell that we're using x86_64. ok > Kernel is: > Linux xxxx 2.6.12.6 #6 SMP Thu Sep 15 12:29:53 CEST 2005 x86_64 Intel(R) Did you find parameters with which the program behaves differently for a file on ext2 and reiserfs? > Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux > > On Tue, 11 Oct 2005, Vladimir V. Saveliev wrote: > >> Hello >> >> Gorazd Golob wrote: >>> >>> ;( >>> >>> works ok if file is bigger than about 4000 bytes. Otherwise read failed. >>> >> Yes, using O_DIRECT you should care about alignment to boundary of 512 >> bytes for >> address of buffer you read to, size of that buffer and offset in a >> file to read >> from. >> >> Please try this version of test program and let us know how to make it >> to behave >> differently for file in reiserfs and ext2. >> What is version of kernel you use? >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: reiser3 and O_DIRECT read 2005-10-11 12:06 ` Vladimir V. Saveliev @ 2005-10-11 16:07 ` Hans Reiser 0 siblings, 0 replies; 14+ messages in thread From: Hans Reiser @ 2005-10-11 16:07 UTC (permalink / raw) To: Vladimir V. Saveliev; +Cc: reiserfs-list What is the detailed status on that work, by the way? ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2005-10-11 16:07 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-10-07 10:13 reiser3 and O_DIRECT read Gorazd Golob 2005-10-07 13:29 ` Vladimir V. Saveliev 2005-10-10 10:41 ` Gorazd Golob 2005-10-10 12:22 ` Vladimir V. Saveliev 2005-10-10 12:30 ` Gorazd Golob 2005-10-10 13:08 ` Vladimir V. Saveliev 2005-10-10 13:22 ` Gorazd Golob 2005-10-10 15:40 ` Gorazd Golob 2005-10-11 6:10 ` Vladimir V. Saveliev 2005-10-11 6:36 ` Gorazd Golob 2005-10-11 7:30 ` Vladimir V. Saveliev 2005-10-11 7:56 ` Gorazd Golob 2005-10-11 12:06 ` Vladimir V. Saveliev 2005-10-11 16:07 ` Hans Reiser
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.