Commit 9117703f authored by Linus Torvalds's avatar Linus Torvalds

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
parents a037a79d fbbf6945
...@@ -26,20 +26,6 @@ config EXT4_FS ...@@ -26,20 +26,6 @@ config EXT4_FS
If unsure, say N. If unsure, say N.
config EXT4DEV_COMPAT
bool "Enable ext4dev compatibility"
depends on EXT4_FS
help
Starting with 2.6.28, the name of the ext4 filesystem was
renamed from ext4dev to ext4. Unfortunately there are some
legacy userspace programs (such as klibc's fstype) have
"ext4dev" hardcoded.
To enable backwards compatibility so that systems that are
still expecting to mount ext4 filesystems using ext4dev,
choose Y here. This feature will go away by 2.6.31, so
please arrange to get your userspace programs fixed!
config EXT4_FS_XATTR config EXT4_FS_XATTR
bool "Ext4 extended attributes" bool "Ext4 extended attributes"
depends on EXT4_FS depends on EXT4_FS
......
...@@ -1146,8 +1146,8 @@ static int check_block_validity(struct inode *inode, const char *msg, ...@@ -1146,8 +1146,8 @@ static int check_block_validity(struct inode *inode, const char *msg,
} }
/* /*
* Return the number of dirty pages in the given inode starting at * Return the number of contiguous dirty pages in a given inode
* page frame idx. * starting at page frame idx.
*/ */
static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx, static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx,
unsigned int max_pages) unsigned int max_pages)
...@@ -1181,15 +1181,15 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx, ...@@ -1181,15 +1181,15 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx,
unlock_page(page); unlock_page(page);
break; break;
} }
head = page_buffers(page); if (page_has_buffers(page)) {
bh = head; bh = head = page_buffers(page);
do { do {
if (!buffer_delay(bh) && if (!buffer_delay(bh) &&
!buffer_unwritten(bh)) { !buffer_unwritten(bh))
done = 1; done = 1;
break; bh = bh->b_this_page;
} while (!done && (bh != head));
} }
} while ((bh = bh->b_this_page) != head);
unlock_page(page); unlock_page(page);
if (done) if (done)
break; break;
...@@ -3378,6 +3378,7 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, ...@@ -3378,6 +3378,7 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
ssize_t ret; ssize_t ret;
int orphan = 0; int orphan = 0;
size_t count = iov_length(iov, nr_segs); size_t count = iov_length(iov, nr_segs);
int retries = 0;
if (rw == WRITE) { if (rw == WRITE) {
loff_t final_size = offset + count; loff_t final_size = offset + count;
...@@ -3400,9 +3401,12 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, ...@@ -3400,9 +3401,12 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
} }
} }
retry:
ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
offset, nr_segs, offset, nr_segs,
ext4_get_block, NULL); ext4_get_block, NULL);
if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
goto retry;
if (orphan) { if (orphan) {
int err; int err;
...@@ -5612,14 +5616,12 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode) ...@@ -5612,14 +5616,12 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
*/ */
void ext4_dirty_inode(struct inode *inode) void ext4_dirty_inode(struct inode *inode)
{ {
handle_t *current_handle = ext4_journal_current_handle();
handle_t *handle; handle_t *handle;
handle = ext4_journal_start(inode, 2); handle = ext4_journal_start(inode, 2);
if (IS_ERR(handle)) if (IS_ERR(handle))
goto out; goto out;
jbd_debug(5, "marking dirty. outer handle=%p\n", current_handle);
ext4_mark_inode_dirty(handle, inode); ext4_mark_inode_dirty(handle, inode);
ext4_journal_stop(handle); ext4_journal_stop(handle);
......
...@@ -3966,27 +3966,6 @@ static struct file_system_type ext4_fs_type = { ...@@ -3966,27 +3966,6 @@ static struct file_system_type ext4_fs_type = {
.fs_flags = FS_REQUIRES_DEV, .fs_flags = FS_REQUIRES_DEV,
}; };
#ifdef CONFIG_EXT4DEV_COMPAT
static int ext4dev_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data,struct vfsmount *mnt)
{
printk(KERN_WARNING "EXT4-fs (%s): Update your userspace programs "
"to mount using ext4\n", dev_name);
printk(KERN_WARNING "EXT4-fs (%s): ext4dev backwards compatibility "
"will go away by 2.6.31\n", dev_name);
return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super,mnt);
}
static struct file_system_type ext4dev_fs_type = {
.owner = THIS_MODULE,
.name = "ext4dev",
.get_sb = ext4dev_get_sb,
.kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV,
};
MODULE_ALIAS("ext4dev");
#endif
static int __init init_ext4_fs(void) static int __init init_ext4_fs(void)
{ {
int err; int err;
...@@ -4011,13 +3990,6 @@ static int __init init_ext4_fs(void) ...@@ -4011,13 +3990,6 @@ static int __init init_ext4_fs(void)
err = register_filesystem(&ext4_fs_type); err = register_filesystem(&ext4_fs_type);
if (err) if (err)
goto out; goto out;
#ifdef CONFIG_EXT4DEV_COMPAT
err = register_filesystem(&ext4dev_fs_type);
if (err) {
unregister_filesystem(&ext4_fs_type);
goto out;
}
#endif
return 0; return 0;
out: out:
destroy_inodecache(); destroy_inodecache();
...@@ -4036,9 +4008,6 @@ static int __init init_ext4_fs(void) ...@@ -4036,9 +4008,6 @@ static int __init init_ext4_fs(void)
static void __exit exit_ext4_fs(void) static void __exit exit_ext4_fs(void)
{ {
unregister_filesystem(&ext4_fs_type); unregister_filesystem(&ext4_fs_type);
#ifdef CONFIG_EXT4DEV_COMPAT
unregister_filesystem(&ext4dev_fs_type);
#endif
destroy_inodecache(); destroy_inodecache();
exit_ext4_xattr(); exit_ext4_xattr();
exit_ext4_mballoc(); exit_ext4_mballoc();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment