Bug 108811
Summary: | overlayfs over xfs cannot delete file | ||
---|---|---|---|
Product: | File System | Reporter: | LiLinZhe (reg) |
Component: | Other | Assignee: | fs_other |
Status: | RESOLVED WILL_FIX_LATER | ||
Severity: | normal | CC: | reg |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.3.0 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Bug Depends on: | 109001 | ||
Bug Blocks: | |||
Attachments: |
quick dirty fix
do not use dir2 ftypes even in v2 dir. |
Description
LiLinZhe
2015-12-03 10:04:49 UTC
Created attachment 196361 [details]
quick dirty fix
A quick look of source code points out
function ovl_dir_read in /linux-4.3/fs/overlayfs/readdir.c
L259: if (!err && rdd->first_maybe_whiteout) {
rdd->first_maybe_whiteout will remains zero in xfs. but works fine in ext4. remove it works for me. still digging why it not work.
attachment 196361 [details] won't work. don't use it.
====
i use xfs v2 dirs.
[root@localhost xfs]# file /home/x
/home/x: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
when track code to xfs. dir_emit always return filetype as 0.
when examine xfs_dir2_sf_getdents / xfs_dir2_block_getdents / xfs_dir2_leaf_getdents. I found dp->d_ops->data_get_ftype / dp->d_ops->sf_get_ftype will always points to xfs_dir2_sfe_get_ftype / xfs_dir2_data_get_ftype. which return XFS_DIR3_FT_UNKNOWN forever.
change to xfs_dir3_sfe_get_ftype / xfs_dir3_data_get_ftype should fix this fine.
I'll submit a patch soon but not expect xfs accept it.(changed libxfs)
Created attachment 196531 [details]
do not use dir2 ftypes even in v2 dir.
thanks dave. to solve this: mkfs.xfs -n ftype=1 still need process dents return d_type == DT_UNKNOWN. |