aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2010-06-06 23:38:51 -0400
committerChris Mason <chris.mason@oracle.com>2010-06-11 11:46:11 -0400
commit4a001071d3549f596c7c3736c5dda8a3a4aba9ed (patch)
treef835cbd0779a8912aa65669bbd44ce3f756c919f
parent9aeead73782c4b8e2a91def36dbf95db28605c95 (diff)
Btrfs: fix loop device on top of btrfs
We cannot use the loop device which has been connected to a file in the btrf The reproduce steps is following: # dd if=/dev/zero of=vdev0 bs=1M count=1024 # losetup /dev/loop0 vdev0 # mkfs.btrfs /dev/loop0 ... failed to zero device start -5 The reason is that the btrfs don't implement either ->write_begin or ->write the VFS API, so we fix it by setting ->write to do_sync_write(). Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 79437c5eeb1e..abcb91867b56 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1197,6 +1197,7 @@ static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma)
1197const struct file_operations btrfs_file_operations = { 1197const struct file_operations btrfs_file_operations = {
1198 .llseek = generic_file_llseek, 1198 .llseek = generic_file_llseek,
1199 .read = do_sync_read, 1199 .read = do_sync_read,
1200 .write = do_sync_write,
1200 .aio_read = generic_file_aio_read, 1201 .aio_read = generic_file_aio_read,
1201 .splice_read = generic_file_splice_read, 1202 .splice_read = generic_file_splice_read,
1202 .aio_write = btrfs_file_aio_write, 1203 .aio_write = btrfs_file_aio_write,