public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] repair: Set ftype for entries in lost+found
@ 2014-07-21 19:21 Jan Kara
  2014-07-22 11:53 ` Brian Foster
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2014-07-21 19:21 UTC (permalink / raw)
  To: xfs; +Cc: Jan Kara

So far all entries in lost+found had file type XFS_DIR3_FT_UNKNOWN which
is somewhat annoying as the next xfs_repair pass will find these and
report as an error. Set proper file type when creating these entries.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 repair/phase6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/repair/phase6.c b/repair/phase6.c
index f13069f4cd71..0ec4f07ca1c2 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -1097,8 +1097,6 @@ 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)
@@ -1117,6 +1115,8 @@ mv_orphanage(
 	if ((err = libxfs_iget(mp, NULL, ino, 0, &ino_p, 0)))
 		do_error(_("%d - couldn't iget disconnected inode\n"), err);
 
+	xname.type = xfs_mode_to_ftype[(ino_p->i_d.di_mode & S_IFMT)>>S_SHIFT];
+
 	if (isa_dir)  {
 		irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, orphanage_ino),
 				XFS_INO_TO_AGINO(mp, orphanage_ino));
-- 
1.8.1.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] repair: Set ftype for entries in lost+found
  2014-07-21 19:21 [PATCH] repair: Set ftype for entries in lost+found Jan Kara
@ 2014-07-22 11:53 ` Brian Foster
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Foster @ 2014-07-22 11:53 UTC (permalink / raw)
  To: Jan Kara; +Cc: xfs

On Mon, Jul 21, 2014 at 09:21:25PM +0200, Jan Kara wrote:
> So far all entries in lost+found had file type XFS_DIR3_FT_UNKNOWN which
> is somewhat annoying as the next xfs_repair pass will find these and
> report as an error. Set proper file type when creating these entries.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  repair/phase6.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/repair/phase6.c b/repair/phase6.c
> index f13069f4cd71..0ec4f07ca1c2 100644
> --- a/repair/phase6.c
> +++ b/repair/phase6.c
> @@ -1097,8 +1097,6 @@ 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)
> @@ -1117,6 +1115,8 @@ mv_orphanage(
>  	if ((err = libxfs_iget(mp, NULL, ino, 0, &ino_p, 0)))
>  		do_error(_("%d - couldn't iget disconnected inode\n"), err);
>  
> +	xname.type = xfs_mode_to_ftype[(ino_p->i_d.di_mode & S_IFMT)>>S_SHIFT];
> +
>  	if (isa_dir)  {
>  		irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, orphanage_ino),
>  				XFS_INO_TO_AGINO(mp, orphanage_ino));
> -- 
> 1.8.1.4
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-22 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-21 19:21 [PATCH] repair: Set ftype for entries in lost+found Jan Kara
2014-07-22 11:53 ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox