Skip to contentSkip to conversation

Memory alignment requirement for Direct/IO

DISCUSSION Xiaoli Feng 2 participants 2 messages Apr 30, 2019 – May 1, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello,

I setup samba server in upstream and mount it in local with cache=none,vers=3.11. Then test the Direct/IO function like this:

fd=open(fname, O_DIRECT | O_RDWR | O_CREAT, 0666)) lseek(fd, 0, SEEK_SET);
read(fd, buf, 1);

For local filesystem such as XFS, "read" will be failed because XFS has 512Byte memory aligment for Direct/IO. But it's success for cifs. I don't know if it's expected. Could anybody tell me more about Direct/IO for cifs?

Thanks.

Signature · 8 lines
Best regards!
XiaoLi Feng 冯小丽

Red Hat Software (Beijing) Co.,Ltd
filesystem-qe Team
IRC:xifeng,#channel: fs-qe
Tel:+86-10-8388112
9/F, Raycom
#2 lore raw

I would expect direct i/o to work with unaligned reads over SMB3 mounts.

Let me know if you see different behavior to any servers.

Quoted 25 lines · Xiaoli Feng

Hello,

I setup samba server in upstream and mount it in local with cache=none,vers=3.11. Then test the Direct/IO function like this:

fd=open(fname, O_DIRECT | O_RDWR | O_CREAT, 0666)) lseek(fd, 0, SEEK_SET);
read(fd, buf, 1);

For local filesystem such as XFS, "read" will be failed because XFS has 512Byte memory aligment for Direct/IO. But it's success for cifs. I don't know if it's expected. Could anybody tell me more about Direct/IO for cifs?

Thanks.

--
Best regards!
XiaoLi Feng 冯小丽

Red Hat Software (Beijing) Co.,Ltd
filesystem-qe Team
IRC:xifeng,#channel: fs-qe
Tel:+86-10-8388112
9/F, Raycom

Signature · 3 lines
Thanks,

Steve