Switch to the WRITE_FLUSH_FUA flag for log writes, remove the EOPNOTSUPP detection for barriers and stop setting the barrier flag for discards. XXX: nilfs2 does not actually wait for discards to finish, so the code after this patch is almost guaranteed to be incorrect when dicards are used. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Index: linux-2.6/fs/nilfs2/super.c =================================================================== --- linux-2.6.orig/fs/nilfs2/super.c 2010-08-17 16:37:07.848008123 +0200 +++ linux-2.6/fs/nilfs2/super.c 2010-08-17 16:39:44.528037875 +0200 @@ -183,17 +183,9 @@ static int nilfs_sync_super(struct nilfs retry: set_buffer_dirty(nilfs->ns_sbh[0]); - if (nilfs_test_opt(sbi, BARRIER)) { err = __sync_dirty_buffer(nilfs->ns_sbh[0], - WRITE_SYNC | WRITE_BARRIER); - if (err == -EOPNOTSUPP) { - nilfs_warning(sbi->s_super, __func__, - "barrier-based sync failed. " - "disabling barriers\n"); - nilfs_clear_opt(sbi, BARRIER); - goto retry; - } + WRITE_SYNC | WRITE_FLUSH_FUA); } else { err = sync_dirty_buffer(nilfs->ns_sbh[0]); } Index: linux-2.6/fs/nilfs2/the_nilfs.c =================================================================== --- linux-2.6.orig/fs/nilfs2/the_nilfs.c 2010-08-17 16:38:22.118254665 +0200 +++ linux-2.6/fs/nilfs2/the_nilfs.c 2010-08-17 16:38:50.459265700 +0200 @@ -674,7 +674,7 @@ int nilfs_discard_segments(struct the_ni start * sects_per_block, nblocks * sects_per_block, GFP_NOFS, - BLKDEV_IFL_BARRIER); + 0); if (ret < 0) return ret; nblocks = 0; @@ -684,7 +684,7 @@ int nilfs_discard_segments(struct the_ni ret = blkdev_issue_discard(nilfs->ns_bdev, start * sects_per_block, nblocks * sects_per_block, - GFP_NOFS, BLKDEV_IFL_BARRIER); + GFP_NOFS, 0); return ret; } -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html