summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-01-11 15:19:04 +0000
committerpfg <pfg@FreeBSD.org>2014-01-11 15:19:04 +0000
commite3a716491dc66cf444878a617b799e0c417206b3 (patch)
tree3e231ef563e55414810e87d9e602afd55e1094d8 /sys/fs
parent60ae67a42bc62b95575cea65e6bf52fbac578fd8 (diff)
downloadFreeBSD-src-e3a716491dc66cf444878a617b799e0c417206b3.zip
FreeBSD-src-e3a716491dc66cf444878a617b799e0c417206b3.tar.gz
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 MFC after: 3 days
Diffstat (limited to 'sys/fs')
-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