Re: ext4-online-defrag-free-space-fragmentation.patch uses do_fsync()

Dave Kleikamp
2008-01-23T14:10:31Z

> diff --git a/fs/ext4/defrag.c b/fs/ext4/defrag.c
> index 4ef3dc0..19d2cfd 100644
> --- a/fs/ext4/defrag.c
> +++ b/fs/ext4/defrag.c
> @@ -632,8 +632,9 @@ static int ext4_ext_defrag_victim(struct file *target_filp,
> }
>
> /* Sync journal blocks before reservation */
> - if (do_fsync(target_filp, 0)) {
> - printk(KERN_ERR "defrag: failed do_fsync\n");
> + ret = ext4_force_commit(sb);
> + if (ret) {
> + printk(KERN_ERR "defrag: failed do_fsync (%d)\n", ret);

I'd think you'd want to change the printk text as well. "defrag: failed
ext4_force_commit (%d)\n" maybe?

> goto ERR;
> }
> }

--
David Kleikamp
IBM Linux Technology Center