diff options
author | Joseph Qi <joseph.qi@huawei.com> | 2013-07-03 18:00:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:23 -0400 |
commit | 13eb98874c837b4ca0cb2db6a4fe3551e51b7632 (patch) | |
tree | 269e356a59d6928b903448a8a020b9c8f21b4bf4 | |
parent | 22ab9014bfdaf97449759aef946871aabe78bb40 (diff) |
ocfs2: should not use le32_add_cpu to set ocfs2_dinode i_flags
If we use le32_add_cpu to set ocfs2_dinode i_flags, it may lead to the
corresponding flag corrupted. So we should change it to bitwise and/or
operation.
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: shencanquan <shencanquan@huawei.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ocfs2/namei.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index b4a5cdf9dbc5..75964addfe32 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -522,7 +522,7 @@ static int __ocfs2_mknod_locked(struct inode *dir, | |||
522 | 522 | ||
523 | fe->i_last_eb_blk = 0; | 523 | fe->i_last_eb_blk = 0; |
524 | strcpy(fe->i_signature, OCFS2_INODE_SIGNATURE); | 524 | strcpy(fe->i_signature, OCFS2_INODE_SIGNATURE); |
525 | le32_add_cpu(&fe->i_flags, OCFS2_VALID_FL); | 525 | fe->i_flags |= cpu_to_le32(OCFS2_VALID_FL); |
526 | fe->i_atime = fe->i_ctime = fe->i_mtime = | 526 | fe->i_atime = fe->i_ctime = fe->i_mtime = |
527 | cpu_to_le64(CURRENT_TIME.tv_sec); | 527 | cpu_to_le64(CURRENT_TIME.tv_sec); |
528 | fe->i_mtime_nsec = fe->i_ctime_nsec = fe->i_atime_nsec = | 528 | fe->i_mtime_nsec = fe->i_ctime_nsec = fe->i_atime_nsec = |
@@ -2044,7 +2044,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
2044 | goto leave; | 2044 | goto leave; |
2045 | } | 2045 | } |
2046 | 2046 | ||
2047 | le32_add_cpu(&fe->i_flags, OCFS2_ORPHANED_FL); | 2047 | fe->i_flags |= cpu_to_le32(OCFS2_ORPHANED_FL); |
2048 | OCFS2_I(inode)->ip_flags &= ~OCFS2_INODE_SKIP_ORPHAN_DIR; | 2048 | OCFS2_I(inode)->ip_flags &= ~OCFS2_INODE_SKIP_ORPHAN_DIR; |
2049 | 2049 | ||
2050 | /* Record which orphan dir our inode now resides | 2050 | /* Record which orphan dir our inode now resides |
@@ -2434,7 +2434,7 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir, | |||
2434 | } | 2434 | } |
2435 | 2435 | ||
2436 | di = (struct ocfs2_dinode *)di_bh->b_data; | 2436 | di = (struct ocfs2_dinode *)di_bh->b_data; |
2437 | le32_add_cpu(&di->i_flags, -OCFS2_ORPHANED_FL); | 2437 | di->i_flags &= ~cpu_to_le32(OCFS2_ORPHANED_FL); |
2438 | di->i_orphaned_slot = 0; | 2438 | di->i_orphaned_slot = 0; |
2439 | set_nlink(inode, 1); | 2439 | set_nlink(inode, 1); |
2440 | ocfs2_set_links_count(di, inode->i_nlink); | 2440 | ocfs2_set_links_count(di, inode->i_nlink); |