ext4: trivial context refresh
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/queue/ext4-fix-deadlock-between-inline_data-and-ext4_expan.patch b/queue/ext4-fix-deadlock-between-inline_data-and-ext4_expan.patch
index b0cdeb7..4914304 100644
--- a/queue/ext4-fix-deadlock-between-inline_data-and-ext4_expan.patch
+++ b/queue/ext4-fix-deadlock-between-inline_data-and-ext4_expan.patch
@@ -1,4 +1,4 @@
-From c755e251357a0cee0679081f08c3f4ba797a8009 Mon Sep 17 00:00:00 2001
+From 8a0e56d34fcae7f78baa08bb54bc98173cd33293 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Wed, 11 Jan 2017 21:50:46 -0500
Subject: [PATCH] ext4: fix deadlock between inline_data and
@@ -101,12 +101,13 @@
Cc: stable@vger.kernel.org # 3.10 (requires 2e81a4eeedca as a prereq)
Reported-by: George Spelvin <linux@sciencehorizons.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
-index 437df6a1a841..99a5312ced52 100644
+index d8ca4b9f9dd6..028329721bbe 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
-@@ -381,7 +381,7 @@ out:
+@@ -376,7 +376,7 @@ out:
static int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
unsigned int len)
{
@@ -115,7 +116,7 @@
struct ext4_inode_info *ei = EXT4_I(inode);
if (!ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA))
-@@ -391,15 +391,14 @@ static int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
+@@ -386,15 +386,14 @@ static int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
if (size < len)
return -ENOSPC;
@@ -133,7 +134,7 @@
return ret;
}
-@@ -533,7 +532,7 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
+@@ -523,7 +522,7 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
struct inode *inode,
unsigned flags)
{
@@ -142,7 +143,7 @@
handle_t *handle = NULL;
int retries = 0, sem_held = 0;
struct page *page = NULL;
-@@ -573,7 +572,7 @@ retry:
+@@ -563,7 +562,7 @@ retry:
goto out;
}
@@ -151,7 +152,7 @@
sem_held = 1;
/* If some one has already done this for us, just exit. */
if (!ext4_has_inline_data(inode)) {
-@@ -610,7 +609,7 @@ retry:
+@@ -600,7 +599,7 @@ retry:
put_page(page);
page = NULL;
ext4_orphan_add(handle, inode);
@@ -160,7 +161,7 @@
sem_held = 0;
ext4_journal_stop(handle);
handle = NULL;
-@@ -636,7 +635,7 @@ out:
+@@ -626,7 +625,7 @@ out:
put_page(page);
}
if (sem_held)
@@ -169,7 +170,7 @@
if (handle)
ext4_journal_stop(handle);
brelse(iloc.bh);
-@@ -729,7 +728,7 @@ convert:
+@@ -719,7 +718,7 @@ convert:
int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
unsigned copied, struct page *page)
{
@@ -178,7 +179,7 @@
void *kaddr;
struct ext4_iloc iloc;
-@@ -747,7 +746,7 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
+@@ -737,7 +736,7 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
goto out;
}
@@ -187,7 +188,7 @@
BUG_ON(!ext4_has_inline_data(inode));
kaddr = kmap_atomic(page);
-@@ -757,7 +756,7 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
+@@ -747,7 +746,7 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
/* clear page dirty so that writepages wouldn't work for us. */
ClearPageDirty(page);
@@ -196,7 +197,7 @@
brelse(iloc.bh);
out:
return copied;
-@@ -768,7 +767,7 @@ ext4_journalled_write_inline_data(struct inode *inode,
+@@ -758,7 +757,7 @@ ext4_journalled_write_inline_data(struct inode *inode,
unsigned len,
struct page *page)
{
@@ -205,7 +206,7 @@
void *kaddr;
struct ext4_iloc iloc;
-@@ -778,11 +777,11 @@ ext4_journalled_write_inline_data(struct inode *inode,
+@@ -768,11 +767,11 @@ ext4_journalled_write_inline_data(struct inode *inode,
return NULL;
}
@@ -219,7 +220,7 @@
return iloc.bh;
}
-@@ -1259,7 +1258,7 @@ out:
+@@ -1249,7 +1248,7 @@ out:
int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname,
struct inode *dir, struct inode *inode)
{
@@ -228,7 +229,7 @@
void *inline_start;
struct ext4_iloc iloc;
-@@ -1267,7 +1266,7 @@ int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname,
+@@ -1257,7 +1256,7 @@ int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname,
if (ret)
return ret;
@@ -237,7 +238,7 @@
if (!ext4_has_inline_data(dir))
goto out;
-@@ -1313,7 +1312,7 @@ int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname,
+@@ -1303,7 +1302,7 @@ int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname,
out:
ext4_mark_inode_dirty(handle, dir);
@@ -246,7 +247,7 @@
brelse(iloc.bh);
return ret;
}
-@@ -1673,7 +1672,7 @@ int ext4_delete_inline_entry(handle_t *handle,
+@@ -1663,7 +1662,7 @@ int ext4_delete_inline_entry(handle_t *handle,
struct buffer_head *bh,
int *has_inline_data)
{
@@ -255,7 +256,7 @@
struct ext4_iloc iloc;
void *inline_start;
-@@ -1681,7 +1680,7 @@ int ext4_delete_inline_entry(handle_t *handle,
+@@ -1671,7 +1670,7 @@ int ext4_delete_inline_entry(handle_t *handle,
if (err)
return err;
@@ -264,7 +265,7 @@
if (!ext4_has_inline_data(dir)) {
*has_inline_data = 0;
goto out;
-@@ -1715,7 +1714,7 @@ int ext4_delete_inline_entry(handle_t *handle,
+@@ -1705,7 +1704,7 @@ int ext4_delete_inline_entry(handle_t *handle,
ext4_show_inline_dir(dir, iloc.bh, inline_start, inline_size);
out:
@@ -273,7 +274,7 @@
brelse(iloc.bh);
if (err != -ENOENT)
ext4_std_error(dir->i_sb, err);
-@@ -1814,11 +1813,11 @@ out:
+@@ -1804,11 +1803,11 @@ out:
int ext4_destroy_inline_data(handle_t *handle, struct inode *inode)
{
@@ -288,7 +289,7 @@
return ret;
}
-@@ -1903,7 +1902,7 @@ out:
+@@ -1893,7 +1892,7 @@ out:
void ext4_inline_data_truncate(struct inode *inode, int *has_inline)
{
handle_t *handle;
@@ -297,7 +298,7 @@
size_t i_size;
void *value = NULL;
struct ext4_xattr_ibody_find is = {
-@@ -1920,7 +1919,7 @@ void ext4_inline_data_truncate(struct inode *inode, int *has_inline)
+@@ -1910,7 +1909,7 @@ void ext4_inline_data_truncate(struct inode *inode, int *has_inline)
if (IS_ERR(handle))
return;
@@ -306,7 +307,7 @@
if (!ext4_has_inline_data(inode)) {
*has_inline = 0;
ext4_journal_stop(handle);
-@@ -1978,7 +1977,7 @@ out_error:
+@@ -1968,7 +1967,7 @@ out_error:
up_write(&EXT4_I(inode)->i_data_sem);
out:
brelse(is.iloc.bh);
@@ -315,7 +316,7 @@
kfree(value);
if (inode->i_nlink)
ext4_orphan_del(handle, inode);
-@@ -1994,7 +1993,7 @@ out:
+@@ -1984,7 +1983,7 @@ out:
int ext4_convert_inline_data(struct inode *inode)
{
@@ -324,7 +325,7 @@
handle_t *handle;
struct ext4_iloc iloc;
-@@ -2016,15 +2015,10 @@ int ext4_convert_inline_data(struct inode *inode)
+@@ -2006,15 +2005,10 @@ int ext4_convert_inline_data(struct inode *inode)
goto out_free;
}
@@ -345,10 +346,10 @@
out_free:
brelse(iloc.bh);
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
-index 5a94fa52b74f..c40bd55b6400 100644
+index 2eb935ca5d9e..78f778719635 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
-@@ -1188,16 +1188,14 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
+@@ -1179,16 +1179,14 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
struct ext4_xattr_block_find bs = {
.s = { .not_found = -ENODATA, },
};
@@ -367,16 +368,16 @@
error = ext4_reserve_inode_write(handle, inode, &is.iloc);
if (error)
-@@ -1264,7 +1262,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
+@@ -1256,7 +1254,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
ext4_xattr_update_super_block(handle, inode->i_sb);
- inode->i_ctime = current_time(inode);
+ inode->i_ctime = ext4_current_time(inode);
if (!value)
- ext4_clear_inode_state(inode, EXT4_STATE_NO_EXPAND);
+ no_expand = 0;
error = ext4_mark_iloc_dirty(handle, inode, &is.iloc);
/*
* The bh is consumed by ext4_mark_iloc_dirty, even with
-@@ -1278,9 +1276,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
+@@ -1270,9 +1268,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
cleanup:
brelse(is.iloc.bh);
brelse(bs.bh);
@@ -387,7 +388,7 @@
return error;
}
-@@ -1497,12 +1493,11 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
+@@ -1356,12 +1352,11 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
int error = 0, tried_min_extra_isize = 0;
int s_min_extra_isize = le16_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_min_extra_isize);
int isize_diff; /* How much do we need to grow i_extra_isize */
@@ -404,8 +405,8 @@
retry:
isize_diff = new_extra_isize - EXT4_I(inode)->i_extra_isize;
if (EXT4_I(inode)->i_extra_isize >= new_extra_isize)
-@@ -1584,17 +1579,16 @@ shift:
- EXT4_I(inode)->i_extra_isize = new_extra_isize;
+@@ -1555,8 +1550,7 @@ retry:
+ }
brelse(bh);
out:
- ext4_clear_inode_state(inode, EXT4_STATE_NO_EXPAND);
@@ -414,6 +415,8 @@
return 0;
cleanup:
+@@ -1568,10 +1562,10 @@ cleanup:
+ kfree(bs);
brelse(bh);
/*
- * We deliberately leave EXT4_STATE_NO_EXPAND set here since inode