@@ -228,11 +228,19 @@ mod linux_android {
228
228
target_arch = "mips64" ,
229
229
target_arch = "mips64el" ,
230
230
target_arch = "powerpc64" ,
231
- target_arch = "powerpc64le" ) ) ) ]
231
+ target_arch = "powerpc64le" ,
232
+ target_env = "musl" ) ) ) ]
232
233
fn test_ofd_write_lock ( ) {
233
234
let tmp = NamedTempFile :: new ( ) . unwrap ( ) ;
234
235
235
236
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
+ }
236
244
let inode = fstat ( fd) . expect ( "fstat failed" ) . st_ino as usize ;
237
245
238
246
let mut flock = libc:: flock {
@@ -262,11 +270,19 @@ mod linux_android {
262
270
target_arch = "mips64" ,
263
271
target_arch = "mips64el" ,
264
272
target_arch = "powerpc64" ,
265
- target_arch = "powerpc64le" ) ) ) ]
273
+ target_arch = "powerpc64le" ,
274
+ target_env = "musl" ) ) ) ]
266
275
fn test_ofd_read_lock ( ) {
267
276
let tmp = NamedTempFile :: new ( ) . unwrap ( ) ;
268
277
269
278
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
+ }
270
286
let inode = fstat ( fd) . expect ( "fstat failed" ) . st_ino as usize ;
271
287
272
288
let mut flock = libc:: flock {
0 commit comments