Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jan 2014 15:21:19 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r260630 - stable/9/sys/fs/ext2fs
Message-ID:  <201401141521.s0EFLJt8018275@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Tue Jan 14 15:21:19 2014
New Revision: 260630
URL: http://svnweb.freebsd.org/changeset/base/260630

Log:
  MFC	r260545:
  
  ext2fs: fix inode flag conversion.
  
  After r252890 we are naively attempting to pass through the
  inode flags.  This is technically incorrect as the ext2
  inode flags don't match the UFS/system values used in
  FreeBSD and a clean conversion is needed.
  
  Some filtering was left in place so the change didn't cause
  significant changes in FreeBSD but some of the garbage passed
  is likely to be the cause for warning messages in linux.
  
  Fix the issue by resetting the flags before conversion as was
  done previously. This also means we will not pass the EXT4_*
  inode flags into FreeBSD's inode.

Modified:
  stable/9/sys/fs/ext2fs/ext2_inode_cnv.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_inode_cnv.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_inode_cnv.c	Tue Jan 14 15:20:33 2014	(r260629)
+++ stable/9/sys/fs/ext2fs/ext2_inode_cnv.c	Tue Jan 14 15:21:19 2014	(r260630)
@@ -104,7 +104,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, stru
 		ip->i_birthtime = ei->e2di_crtime;
 		ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra);
 	}
-	ip->i_flags = ei->e2di_flags;
+	ip->i_flags = 0;
 	ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0;
 	ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0;
 	ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0;
@@ -152,7 +152,7 @@ ext2_i2ei(struct inode *ip, struct ext2f
 		ei->e2di_crtime = ip->i_birthtime;
 		ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec);
 	}
-	ei->e2di_flags = ip->i_flags;
+	ei->e2di_flags = 0;
 	ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0;
 	ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0;
 	ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401141521.s0EFLJt8018275>