summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-01-14 15:20:33 +0000
committerpfg <pfg@FreeBSD.org>2014-01-14 15:20:33 +0000
commitb405aa87ad83bc16c9b28571bd0fe2d34d9ebf25 (patch)
treefe034dea529dfaa842e66e11af8fa9b53e007e7b
parent5889b488e31225968f5fcac07ee42c2ac6afa30d (diff)
downloadFreeBSD-src-b405aa87ad83bc16c9b28571bd0fe2d34d9ebf25.zip
FreeBSD-src-b405aa87ad83bc16c9b28571bd0fe2d34d9ebf25.tar.gz
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. PR: kern/185448
-rw-r--r--sys/fs/ext2fs/ext2_inode_cnv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/ext2fs/ext2_inode_cnv.c b/sys/fs/ext2fs/ext2_inode_cnv.c
index c26784b..67712d0 100644
--- a/sys/fs/ext2fs/ext2_inode_cnv.c
+++ b/sys/fs/ext2fs/ext2_inode_cnv.c
@@ -104,7 +104,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip)
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 ext2fs_dinode *ei)
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;
OpenPOWER on IntegriCloud