hanwen / go-fuse

FUSE bindings for Go
Other
1.97k stars 313 forks source link

fs: bridge: Add missing Lseek whence checks #488

Closed turan18 closed 9 months ago

turan18 commented 10 months ago

The man page for Lseek says that the filesystem should return an ENXIO when the offset is greater than the file size on either SEEK_DATA or SEEK_HOLE or if the offset is set to the end of the file with SEEK_DATA (where there is an implicit hole). Adding these checks to the current Lseek implementation.

Resolves: #487

hanwen commented 9 months ago

needs a test

hanwen commented 9 months ago

since this is generic filesystem behavior, you can add a test under posixtest

hanwen commented 9 months ago

see https://review.gerrithub.io/c/hanwen/go-fuse/+/1168743

turan18 commented 9 months ago

needs a test

Added some tests under posixtest. PTAL: @hanwen

turan18 commented 9 months ago

Hey, could you take another look when you the chance? @hanwen

hanwen commented 9 months ago

i'll merge it today. sorry for the delay

hanwen commented 9 months ago

https://github.com/hanwen/go-fuse/commit/fc2c4d3da0a07dd49fa7c826f406c8e9c2842f32