@@ -228,11 +228,19 @@ mod linux_android {
228228 target_arch = "mips64" ,
229229 target_arch = "mips64el" ,
230230 target_arch = "powerpc64" ,
231- target_arch = "powerpc64le" ) ) ) ]
231+ target_arch = "powerpc64le" ,
232+ target_env = "musl" ) ) ) ]
232233 fn test_ofd_write_lock ( ) {
233234 let tmp = NamedTempFile :: new ( ) . unwrap ( ) ;
234235
235236 let fd = tmp. as_raw_fd ( ) ;
237+ let statfs = nix:: sys:: statfs:: fstatfs ( & tmp) . unwrap ( ) ;
238+ if statfs. filesystem_type ( ) == nix:: sys:: statfs:: OVERLAYFS_SUPER_MAGIC {
239+ // OverlayFS is a union file system. It returns one inode value in
240+ // stat(2), but a different one shows up in /proc/locks. So we must
241+ // skip the test.
242+ skip ! ( "/proc/locks does not work on overlayfs" ) ;
243+ }
236244 let inode = fstat ( fd) . expect ( "fstat failed" ) . st_ino as usize ;
237245
238246 let mut flock = libc:: flock {
@@ -262,11 +270,19 @@ mod linux_android {
262270 target_arch = "mips64" ,
263271 target_arch = "mips64el" ,
264272 target_arch = "powerpc64" ,
265- target_arch = "powerpc64le" ) ) ) ]
273+ target_arch = "powerpc64le" ,
274+ target_env = "musl" ) ) ) ]
266275 fn test_ofd_read_lock ( ) {
267276 let tmp = NamedTempFile :: new ( ) . unwrap ( ) ;
268277
269278 let fd = tmp. as_raw_fd ( ) ;
279+ let statfs = nix:: sys:: statfs:: fstatfs ( & tmp) . unwrap ( ) ;
280+ if statfs. filesystem_type ( ) == nix:: sys:: statfs:: OVERLAYFS_SUPER_MAGIC {
281+ // OverlayFS is a union file system. It returns one inode value in
282+ // stat(2), but a different one shows up in /proc/locks. So we must
283+ // skip the test.
284+ skip ! ( "/proc/locks does not work on overlayfs" ) ;
285+ }
270286 let inode = fstat ( fd) . expect ( "fstat failed" ) . st_ino as usize ;
271287
272288 let mut flock = libc:: flock {
0 commit comments