aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-03 14:24:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-03 14:24:19 -0400
commit9117703fabe4141dae566d683eeb728f638c9e49 (patch)
treeefe85f18c6fe5f7d1513d19b01183d050a6b130f
parenta037a79dceaf717409fbf42f4ad209b9c15f435c (diff)
parentfbbf69456619de5d251cb9f1df609069178c62d5 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: [PATCH] ext4: retry failed direct IO allocations ext4: Fix build warning in ext4_dirty_inode() ext4: drop ext4dev compat ext4: fix a BUG_ON crash by checking that page has buffers attached to it
-rw-r--r--fs/ext4/Kconfig14
-rw-r--r--fs/ext4/inode.c28
-rw-r--r--fs/ext4/super.c31
3 files changed, 15 insertions, 58 deletions
diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig
index d5c0ea2e8f2..9f2d45d75b1 100644
--- a/fs/ext4/Kconfig
+++ b/fs/ext4/Kconfig
@@ -26,20 +26,6 @@ config EXT4_FS
26 26
27 If unsure, say N. 27 If unsure, say N.
28 28
29config EXT4DEV_COMPAT
30 bool "Enable ext4dev compatibility"
31 depends on EXT4_FS
32 help
33 Starting with 2.6.28, the name of the ext4 filesystem was
34 renamed from ext4dev to ext4. Unfortunately there are some
35 legacy userspace programs (such as klibc's fstype) have
36 "ext4dev" hardcoded.
37
38 To enable backwards compatibility so that systems that are
39 still expecting to mount ext4 filesystems using ext4dev,
40 choose Y here. This feature will go away by 2.6.31, so
41 please arrange to get your userspace programs fixed!
42
43config EXT4_FS_XATTR 29config EXT4_FS_XATTR
44 bool "Ext4 extended attributes" 30 bool "Ext4 extended attributes"
45 depends on EXT4_FS 31 depends on EXT4_FS
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index ec367bce721..5c5bc5dafff 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1146,8 +1146,8 @@ static int check_block_validity(struct inode *inode, const char *msg,
1146} 1146}
1147 1147
1148/* 1148/*
1149 * Return the number of dirty pages in the given inode starting at 1149 * Return the number of contiguous dirty pages in a given inode
1150 * page frame idx. 1150 * starting at page frame idx.
1151 */ 1151 */
1152static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx, 1152static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx,
1153 unsigned int max_pages) 1153 unsigned int max_pages)
@@ -1181,15 +1181,15 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx,
1181 unlock_page(page); 1181 unlock_page(page);
1182 break; 1182 break;
1183 } 1183 }
1184 head = page_buffers(page); 1184 if (page_has_buffers(page)) {
1185 bh = head; 1185 bh = head = page_buffers(page);
1186 do { 1186 do {
1187 if (!buffer_delay(bh) && 1187 if (!buffer_delay(bh) &&
1188 !buffer_unwritten(bh)) { 1188 !buffer_unwritten(bh))
1189 done = 1; 1189 done = 1;
1190 break; 1190 bh = bh->b_this_page;
1191 } 1191 } while (!done && (bh != head));
1192 } while ((bh = bh->b_this_page) != head); 1192 }
1193 unlock_page(page); 1193 unlock_page(page);
1194 if (done) 1194 if (done)
1195 break; 1195 break;
@@ -3378,6 +3378,7 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
3378 ssize_t ret; 3378 ssize_t ret;
3379 int orphan = 0; 3379 int orphan = 0;
3380 size_t count = iov_length(iov, nr_segs); 3380 size_t count = iov_length(iov, nr_segs);
3381 int retries = 0;
3381 3382
3382 if (rw == WRITE) { 3383 if (rw == WRITE) {
3383 loff_t final_size = offset + count; 3384 loff_t final_size = offset + count;
@@ -3400,9 +3401,12 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
3400 } 3401 }
3401 } 3402 }
3402 3403
3404retry:
3403 ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, 3405 ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
3404 offset, nr_segs, 3406 offset, nr_segs,
3405 ext4_get_block, NULL); 3407 ext4_get_block, NULL);
3408 if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
3409 goto retry;
3406 3410
3407 if (orphan) { 3411 if (orphan) {
3408 int err; 3412 int err;
@@ -5612,14 +5616,12 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
5612 */ 5616 */
5613void ext4_dirty_inode(struct inode *inode) 5617void ext4_dirty_inode(struct inode *inode)
5614{ 5618{
5615 handle_t *current_handle = ext4_journal_current_handle();
5616 handle_t *handle; 5619 handle_t *handle;
5617 5620
5618 handle = ext4_journal_start(inode, 2); 5621 handle = ext4_journal_start(inode, 2);
5619 if (IS_ERR(handle)) 5622 if (IS_ERR(handle))
5620 goto out; 5623 goto out;
5621 5624
5622 jbd_debug(5, "marking dirty. outer handle=%p\n", current_handle);
5623 ext4_mark_inode_dirty(handle, inode); 5625 ext4_mark_inode_dirty(handle, inode);
5624 5626
5625 ext4_journal_stop(handle); 5627 ext4_journal_stop(handle);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 12e726a7073..312211ee05a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3966,27 +3966,6 @@ static struct file_system_type ext4_fs_type = {
3966 .fs_flags = FS_REQUIRES_DEV, 3966 .fs_flags = FS_REQUIRES_DEV,
3967}; 3967};
3968 3968
3969#ifdef CONFIG_EXT4DEV_COMPAT
3970static int ext4dev_get_sb(struct file_system_type *fs_type, int flags,
3971 const char *dev_name, void *data,struct vfsmount *mnt)
3972{
3973 printk(KERN_WARNING "EXT4-fs (%s): Update your userspace programs "
3974 "to mount using ext4\n", dev_name);
3975 printk(KERN_WARNING "EXT4-fs (%s): ext4dev backwards compatibility "
3976 "will go away by 2.6.31\n", dev_name);
3977 return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super,mnt);
3978}
3979
3980static struct file_system_type ext4dev_fs_type = {
3981 .owner = THIS_MODULE,
3982 .name = "ext4dev",
3983 .get_sb = ext4dev_get_sb,
3984 .kill_sb = kill_block_super,
3985 .fs_flags = FS_REQUIRES_DEV,
3986};
3987MODULE_ALIAS("ext4dev");
3988#endif
3989
3990static int __init init_ext4_fs(void) 3969static int __init init_ext4_fs(void)
3991{ 3970{
3992 int err; 3971 int err;
@@ -4011,13 +3990,6 @@ static int __init init_ext4_fs(void)
4011 err = register_filesystem(&ext4_fs_type); 3990 err = register_filesystem(&ext4_fs_type);
4012 if (err) 3991 if (err)
4013 goto out; 3992 goto out;
4014#ifdef CONFIG_EXT4DEV_COMPAT
4015 err = register_filesystem(&ext4dev_fs_type);
4016 if (err) {
4017 unregister_filesystem(&ext4_fs_type);
4018 goto out;
4019 }
4020#endif
4021 return 0; 3993 return 0;
4022out: 3994out:
4023 destroy_inodecache(); 3995 destroy_inodecache();
@@ -4036,9 +4008,6 @@ out4:
4036static void __exit exit_ext4_fs(void) 4008static void __exit exit_ext4_fs(void)
4037{ 4009{
4038 unregister_filesystem(&ext4_fs_type); 4010 unregister_filesystem(&ext4_fs_type);
4039#ifdef CONFIG_EXT4DEV_COMPAT
4040 unregister_filesystem(&ext4dev_fs_type);
4041#endif
4042 destroy_inodecache(); 4011 destroy_inodecache();
4043 exit_ext4_xattr(); 4012 exit_ext4_xattr();
4044 exit_ext4_mballoc(); 4013 exit_ext4_mballoc();