===================================================================
--- linux-stage.orig/fs/ext3/inode.c 2005-02-25 16:47:04.415976672 +0200
+++ linux-stage/fs/ext3/inode.c 2005-02-25 16:50:40.756087976 +0200
-@@ -2274,7 +2274,7 @@
+@@ -2274,7 +2274,7 @@ static unsigned long ext3_get_inode_bloc
* trying to determine the inode's location on-disk and no read need be
* performed.
*/
struct ext3_iloc *iloc, int in_mem)
{
unsigned long block;
-@@ -2484,6 +2484,11 @@
+@@ -2484,6 +2484,11 @@ void ext3_read_inode(struct inode * inod
ei->i_data[block] = raw_inode->i_block[block];
INIT_LIST_HEAD(&ei->i_orphan);
if (S_ISREG(inode->i_mode)) {
inode->i_op = &ext3_file_inode_operations;
inode->i_fop = &ext3_file_operations;
-@@ -2619,6 +2624,9 @@
+@@ -2619,6 +2624,9 @@ static int ext3_do_update_inode(handle_t
} else for (block = 0; block < EXT3_N_BLOCKS; block++)
raw_inode->i_block[block] = ei->i_data[block];
BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
rc = ext3_journal_dirty_metadata(handle, bh);
if (!err)
+@@ -2849,7 +2857,8 @@ ext3_reserve_inode_write(handle_t *handl
+ {
+ int err = 0;
+ if (handle) {
+- err = ext3_get_inode_loc(inode, iloc, 1);
++ err = ext3_get_inode_loc(inode, iloc, EXT3_I(inode)->i_state &
++ EXT3_STATE_NEW);
+ if (!err) {
+ BUFFER_TRACE(iloc->bh, "get_write_access");
+ err = ext3_journal_get_write_access(handle, iloc->bh);
Index: linux-stage/fs/ext3/xattr.c
===================================================================
--- linux-stage.orig/fs/ext3/xattr.c 2005-02-25 16:47:04.422975608 +0200
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOENT;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return 0;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return ret;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return -EIO;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOSPC;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return err;
+ raw_inode = ext3_raw_inode(&iloc);
BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
rc = ext3_journal_dirty_metadata(handle, bh);
if (!err)
+@@ -2849,7 +2857,8 @@ ext3_reserve_inode_write(handle_t *handl
+ {
+ int err = 0;
+ if (handle) {
+- err = ext3_get_inode_loc(inode, iloc, 1);
++ err = ext3_get_inode_loc(inode, iloc, EXT3_I(inode)->i_state &
++ EXT3_STATE_NEW);
+ if (!err) {
+ BUFFER_TRACE(iloc->bh, "get_write_access");
+ err = ext3_journal_get_write_access(handle, iloc->bh);
Index: linux-2.6.0/fs/ext3/xattr.c
===================================================================
--- linux-2.6.0.orig/fs/ext3/xattr.c 2003-12-30 08:33:13.000000000 +0300
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOENT;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return 0;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return ret;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return -EIO;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOSPC;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return err;
+ raw_inode = ext3_raw_inode(&iloc);
Details : This is the liblustre equivalent of the fix for bug 6196. Fixes
ATTR_SIZE and lsm use in llu_setattr_raw.
+Severity : critical
+Bugzilla : 6866
+Frequency : rare, only 2.6 kernels
+Description: Unusual file access patterns on the MDS may result in inode
+ data being lost in very rare circumstances.
+Details : Bad interaction between the ea-in-inode patch and the "no-read"
+ code in the 2.6 kernel caused the inode and/or EA data not to
+ be read from disk, causing single-file corruption.
+
------------------------------------------------------------------------------
2005-07-07 Cluster File Systems, Inc. <info@clusterfs.com>
===================================================================
--- linux-stage.orig/fs/ext3/inode.c 2005-02-25 16:47:04.415976672 +0200
+++ linux-stage/fs/ext3/inode.c 2005-02-25 16:50:40.756087976 +0200
-@@ -2274,7 +2274,7 @@
+@@ -2274,7 +2274,7 @@ static unsigned long ext3_get_inode_bloc
* trying to determine the inode's location on-disk and no read need be
* performed.
*/
struct ext3_iloc *iloc, int in_mem)
{
unsigned long block;
-@@ -2484,6 +2484,11 @@
+@@ -2484,6 +2484,11 @@ void ext3_read_inode(struct inode * inod
ei->i_data[block] = raw_inode->i_block[block];
INIT_LIST_HEAD(&ei->i_orphan);
if (S_ISREG(inode->i_mode)) {
inode->i_op = &ext3_file_inode_operations;
inode->i_fop = &ext3_file_operations;
-@@ -2619,6 +2624,9 @@
+@@ -2619,6 +2624,9 @@ static int ext3_do_update_inode(handle_t
} else for (block = 0; block < EXT3_N_BLOCKS; block++)
raw_inode->i_block[block] = ei->i_data[block];
BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
rc = ext3_journal_dirty_metadata(handle, bh);
if (!err)
+@@ -2849,7 +2857,8 @@ ext3_reserve_inode_write(handle_t *handl
+ {
+ int err = 0;
+ if (handle) {
+- err = ext3_get_inode_loc(inode, iloc, 1);
++ err = ext3_get_inode_loc(inode, iloc, EXT3_I(inode)->i_state &
++ EXT3_STATE_NEW);
+ if (!err) {
+ BUFFER_TRACE(iloc->bh, "get_write_access");
+ err = ext3_journal_get_write_access(handle, iloc->bh);
Index: linux-stage/fs/ext3/xattr.c
===================================================================
--- linux-stage.orig/fs/ext3/xattr.c 2005-02-25 16:47:04.422975608 +0200
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOENT;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return 0;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return ret;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return -EIO;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOSPC;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return err;
+ raw_inode = ext3_raw_inode(&iloc);
BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
rc = ext3_journal_dirty_metadata(handle, bh);
if (!err)
+@@ -2849,7 +2857,8 @@ ext3_reserve_inode_write(handle_t *handl
+ {
+ int err = 0;
+ if (handle) {
+- err = ext3_get_inode_loc(inode, iloc, 1);
++ err = ext3_get_inode_loc(inode, iloc, EXT3_I(inode)->i_state &
++ EXT3_STATE_NEW);
+ if (!err) {
+ BUFFER_TRACE(iloc->bh, "get_write_access");
+ err = ext3_journal_get_write_access(handle, iloc->bh);
Index: linux-2.6.0/fs/ext3/xattr.c
===================================================================
--- linux-2.6.0.orig/fs/ext3/xattr.c 2003-12-30 08:33:13.000000000 +0300
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOENT;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return 0;
+
-+ ret = ext3_get_inode_loc(inode, &iloc, 1);
++ ret = ext3_get_inode_loc(inode, &iloc, 0);
+ if (ret)
+ return ret;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return ret;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return -EIO;
+ raw_inode = ext3_raw_inode(&iloc);
+ if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE)
+ return -ENOSPC;
+
-+ err = ext3_get_inode_loc(inode, &iloc, 1);
++ err = ext3_get_inode_loc(inode, &iloc, 0);
+ if (err)
+ return err;
+ raw_inode = ext3_raw_inode(&iloc);