Mellanox / spdk

Storage Performance Development Kit
http://www.spdk.io/
Other
7 stars 15 forks source link

fsdev: Unmask O_DRIECT for openat /proc/self/fd #95

Closed brianplus closed 6 months ago

brianplus commented 6 months ago

Remove the O_DIRECT flag since openat doesn't support open symbolic link. But in /proc/self/fd they are all symbolic.

anton-nayshtut commented 6 months ago

@brianplus could you please elaborate regarding this patch? What's the problem you're trying to solve?

I see that there's no such logic, for example, in the libfuse. So why do we need it here?

Thanks a lot!

brianplus commented 6 months ago

@anton-nayshtut Thanks for your reviewing. In snap we hit some problem when run fio with -direct=1, such as fio -name=mytest -filename=/tmp/bf_dir/vfs_test.txt -thread -direct=1 -rw=randread -bs=256K -group_reporting -ioengine=libaio -numjobs=1 -iodepth=1 --time_based --runtime=60 --size=1G mytest: (g=0): rw=randread, bs=(R) 256KiB-256KiB, (W) 256KiB-256KiB, (T) 256KiB-256KiB, ioengine=libaio, iodepth=1 fio-3.35 Starting 1 thread fio: pid=2482, err=20/file:filesetup.c:794, func=open(/tmp/bf_dir/vfs_test.txt), error=Not a directory

brianplus commented 6 months ago

I refer to https://elixir.bootlin.com/qemu/v5.0.1/source/tools/virtiofsd/passthrough_ll.c#L1953. In update_open_flags, it unmasks O_DIRECT. https://elixir.bootlin.com/qemu/v5.0.1/source/tools/virtiofsd/passthrough_ll.c#L1708

brianplus commented 6 months ago

@anton-nayshtut I will research more and give your more details about the fix. Thanks a lot. 👍

anton-nayshtut commented 6 months ago

Great! Thanks! We'll incorporate your fix shortly. update_open_flags seems to be convincing. I'll make an additional small research and we'll incorporate you change.