From: Eric Sandeen Date: Fri, 18 Oct 2013 17:59:36 +0000 (+0000) Subject: xfs_repair: add d_type when moving files to lost+found X-Git-Tag: v3.2.0-alpha2~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cca1dbd1c3e12d270a9baa5f85e548e8a5a2125;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: add d_type when moving files to lost+found When we move disconnected inodes to lost+found, they aren't assigned a dtype. Fix this by just setting XFS_DIR3_FT_UNKNOWN for now. If the files are moved out of lost+found, the type will be properly set at that time. When repair gains more type knowledge we could use xfs_mode_to_ftype[] to set the proper type when moved, but right now it's not a big deal; UNKNOWN will suffice for files in lost+found, and prevents us from using an uninitialized value. Signed-off-by: Eric Sandeen Reviewed-by: Rich Johnston Signed-off-by: Rich Johnston --- diff --git a/repair/phase6.c b/repair/phase6.c index f84bdc083..41f6bfc2b 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -1041,6 +1041,8 @@ mv_orphanage( xname.name = fname; xname.len = snprintf((char *)fname, sizeof(fname), "%llu", (unsigned long long)ino); + /* XXX use xfs_mode_to_ftype[] when userspace gains it */ + xname.type = XFS_DIR3_FT_UNKNOWN; err = libxfs_iget(mp, NULL, orphanage_ino, 0, &orphanage_ip, 0); if (err)