path: root/ctree.h
diff options
authorQu Wenruo <>2016-08-19 16:13:05 +0800
committerDavid Sterba <>2016-08-19 13:52:43 +0200
commitbdadea75e47f21682b745678c9b685e491c5e8a3 (patch)
tree8bd80719e08007a1e44793ea1968392944194b5e /ctree.h
parent55aa862ea21c733cbc0444955006856321e9e957 (diff)
btrfs-progs: convert: Fix a regression that ext2_save/image is not readonly
The new convert treats the convert image as a normal file, without any special flags and permissions. This is different from original code: 1) Permission changed from 0400 to 0600 2) Inode lacks READONLY flag This makes we can read-write mount the ext2 image and cause rollback failure. Follow old code behavior, use 0400 permission and add back READONLY flag to fix it. Signed-off-by: Qu Wenruo <> Signed-off-by: David Sterba <>
Diffstat (limited to 'ctree.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index dda72d0e..b9fb732c 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2578,6 +2578,8 @@ int check_dir_conflict(struct btrfs_root *root, char *name, int namelen,
u64 dir, u64 index);
int btrfs_new_inode(struct btrfs_trans_handle *trans, struct btrfs_root *root,
u64 ino, u32 mode);
+int btrfs_change_inode_flags(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root, u64 ino, u64 flags);
int btrfs_add_link(struct btrfs_trans_handle *trans, struct btrfs_root *root,
u64 ino, u64 parent_ino, char *name, int namelen,
u8 type, u64 *index, int add_backref);