diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-11 17:18:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-11 17:18:47 -0400 |
commit | b25b550bb153626df6a48eb8583e923e3dfcf64a (patch) | |
tree | baca9843877b8b3a254cde92ac2a9072014b5621 /fs/btrfs/file.c | |
parent | eda054770e5cd0e9ee1568dfcbcf39f9ade4f545 (diff) | |
parent | 6f902af400b2499c80865c62a06fbbd15cf804fd (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
Btrfs: The file argument for fsync() is never null
Btrfs: handle ERR_PTR from posix_acl_from_xattr()
Btrfs: avoid BUG when dropping root and reference in same transaction
Btrfs: prohibit a operation of changing acl's mask when noacl mount option used
Btrfs: should add a permission check for setfacl
Btrfs: btrfs_lookup_dir_item() can return ERR_PTR
Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
Btrfs: unwind after btrfs_start_transaction() errors
Btrfs: btrfs_iget() returns ERR_PTR
Btrfs: handle kzalloc() failure in open_ctree()
Btrfs: handle error returns from btrfs_lookup_dir_item()
Btrfs: Fix BUG_ON for fs converted from extN
Btrfs: Fix null dereference in relocation.c
Btrfs: fix remap_file_pages error
Btrfs: uninitialized data is check_path_shared()
Btrfs: fix fallocate regression
Btrfs: fix loop device on top of btrfs
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 787b50a16a14..e354c33df082 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1140,7 +1140,7 @@ int btrfs_sync_file(struct file *file, int datasync) | |||
1140 | /* | 1140 | /* |
1141 | * ok we haven't committed the transaction yet, lets do a commit | 1141 | * ok we haven't committed the transaction yet, lets do a commit |
1142 | */ | 1142 | */ |
1143 | if (file && file->private_data) | 1143 | if (file->private_data) |
1144 | btrfs_ioctl_trans_end(file); | 1144 | btrfs_ioctl_trans_end(file); |
1145 | 1145 | ||
1146 | trans = btrfs_start_transaction(root, 0); | 1146 | trans = btrfs_start_transaction(root, 0); |
@@ -1190,14 +1190,22 @@ static const struct vm_operations_struct btrfs_file_vm_ops = { | |||
1190 | 1190 | ||
1191 | static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma) | 1191 | static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma) |
1192 | { | 1192 | { |
1193 | vma->vm_ops = &btrfs_file_vm_ops; | 1193 | struct address_space *mapping = filp->f_mapping; |
1194 | |||
1195 | if (!mapping->a_ops->readpage) | ||
1196 | return -ENOEXEC; | ||
1197 | |||
1194 | file_accessed(filp); | 1198 | file_accessed(filp); |
1199 | vma->vm_ops = &btrfs_file_vm_ops; | ||
1200 | vma->vm_flags |= VM_CAN_NONLINEAR; | ||
1201 | |||
1195 | return 0; | 1202 | return 0; |
1196 | } | 1203 | } |
1197 | 1204 | ||
1198 | const struct file_operations btrfs_file_operations = { | 1205 | const struct file_operations btrfs_file_operations = { |
1199 | .llseek = generic_file_llseek, | 1206 | .llseek = generic_file_llseek, |
1200 | .read = do_sync_read, | 1207 | .read = do_sync_read, |
1208 | .write = do_sync_write, | ||
1201 | .aio_read = generic_file_aio_read, | 1209 | .aio_read = generic_file_aio_read, |
1202 | .splice_read = generic_file_splice_read, | 1210 | .splice_read = generic_file_splice_read, |
1203 | .aio_write = btrfs_file_aio_write, | 1211 | .aio_write = btrfs_file_aio_write, |