need_fix = 1;
}
}
- if (need_fix && !c.ro) {
+ if (need_fix && f2fs_dev_is_writable()) {
u64 ssa_blk;
int ret2;
need_fix = 1;
}
}
- if (need_fix && !c.ro) {
+ if (need_fix && f2fs_dev_is_writable()) {
u64 ssa_blk;
int ret2;
}
/* drop extent information to avoid potential wrong access */
- if (need_fix && !c.ro)
+ if (need_fix && f2fs_dev_is_writable())
node_blk->i.i_ext.len = 0;
if ((c.feature & cpu_to_le32(F2FS_FEATURE_INODE_CHKSUM)) &&
}
}
- if (need_fix && !c.ro) {
+ if (need_fix && f2fs_dev_is_writable()) {
ret = dev_write_block(node_blk, ni->blk_addr);
ASSERT(ret >= 0);
}
FIX_MSG("[0x%x] dn.addr[%d] = 0", nid, idx);
}
}
- if (need_fix && !c.ro) {
+ if (need_fix && f2fs_dev_is_writable()) {
ret = dev_write_block(node_blk, ni->blk_addr);
ASSERT(ret >= 0);
}
}
}
- if (need_fix && !c.ro) {
+ if (need_fix && f2fs_dev_is_writable()) {
struct node_info ni;
nid_t nid = le32_to_cpu(node_blk->footer.nid);
}
}
- if (need_fix && !c.ro) {
+ if (need_fix && f2fs_dev_is_writable()) {
struct node_info ni;
nid_t nid = le32_to_cpu(node_blk->footer.nid);
de_blk->dentry, de_blk->filename,
NR_DENTRY_IN_BLOCK, last_blk, enc_name);
- if (dentries < 0 && !c.ro) {
+ if (dentries < 0 && f2fs_dev_is_writable()) {
ret = dev_write_block(de_blk, blk_addr);
ASSERT(ret >= 0);
DBG(1, "[%3d] Dentry Block [0x%x] Fixed hash_codes\n\n",
else if (ret)
ASSERT_MSG("[0x%x] wrong orphan inode", ino);
}
- if (!c.ro && c.fix_on &&
+ if (f2fs_dev_is_writable() && c.fix_on &&
entry_count != new_entry_count) {
new_blk->entry_count = cpu_to_le32(new_entry_count);
ret = dev_write_block(new_blk, start_blk + i);
}
#endif
/* fix global metadata */
- if (force || (c.fix_on && !c.ro)) {
+ if (force || (c.fix_on && f2fs_dev_is_writable())) {
struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
if (force || c.bug_on || c.bug_nat_bits) {