ext4: add a new spinlock i_raw_lock to protect the ext4's raw inode
Theodore Ts'o
maintainerPATCH 1/1 ext4: add a new spinlock i_raw_lock to protect the ext4's raw inode
To avoid potential data races, use a spinlock which protects the raw (on-disk) inode.
--- fs/ext4/ext4.h | 2 ++ fs/ext4/inode.c | 5 ++++- fs/ext4/super.c | 1 + 3 files changed, 7 insertions(+), 1 deletion(-)
fs/ext4/ext4.h +2 -0
@@ -875,6 +875,8 @@ struct ext4_inode_info {struct inode vfs_inode;struct jbd2_inode *jinode; +spinlock_t i_raw_lock;/* protects updates to the raw inode */ +/* * File creation time. Its function is same as that of * struct timespec i_{a,c,m}time in the generic inode.
fs/ext4/inode.c +4 -1
@@ -4311,7 +4311,9 @@ static int ext4_do_update_inode(handle_t *handle,uid_t i_uid;gid_t i_gid; -/* For fields not not tracking in the in-memory inode, +spin_lock (&ei->i_raw_lock); + +/* For fields not tracked in the in-memory inode, * initialise them to zero for new inodes. */ if (ext4_test_inode_state (inode,EXT4_STATE_NEW ))memset (raw_inode,0 ,EXT4_SB (inode->i_sb)->s_inode_size);
@@ -4419,6 +4421,7 @@ static int ext4_do_update_inode(handle_t *handle,ext4_update_inode_fsync_trans (handle, inode, need_datasync); out_brelse: +spin_unlock (&ei->i_raw_lock);brelse (bh);ext4_std_error (inode->i_sb, err);return err;
fs/ext4/super.c +1 -0
@@ -879,6 +879,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)return NULL ; ei->vfs_inode.i_version =1 ; +spin_lock_init (&ei->i_raw_lock);INIT_LIST_HEAD (&ei->i_prealloc_list);spin_lock_init (&ei->i_prealloc_lock);ext4_es_init_tree (&ei->i_es_tree);
Signature · 6 lines
1.9.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Theodore Ts'o
maintainerPATCH 1/3 generic/004: fix filtering of expected error message
The failure message goes to stderr, so we need to redirect stderr to stdout before running sed.
--- tests/generic/004 | 2 +- tests/generic/004.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tests/generic/004 +1 -1
@@ -58,7 +58,7 @@ $XFS_IO_PROG -T \ rm ${testfile} # test creating a r/o tmpfile. Should fail -$XFS_IO_PROG -Tr ${TEST_DIR} -c "close" | _filter_test_dir +$XFS_IO_PROG -Tr ${TEST_DIR} -c "close" 2>&1 | _filter_test_dir # success, all done status=0
tests/generic/004.out +1 -1
@@ -3,4 +3,4 @@ wrote 4096/4096 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 4096/4096 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -/mnt/test: Invalid argument +TEST_DIR: Invalid argument
Signature · 6 lines
1.9.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 1/3] generic/004: fix filtering of expected error message
Quoted 2 lines · Theodore Ts'o
The failure message goes to stderr, so we need to redirect stderr to stdout before running sed.
Heh, whoops.
Quoted 31 lines
Signed-off-by "Theodore Ts'o" <[email protected]>Cc Christoph Hellwig <[email protected]>--- tests/generic/004 | 2 +- tests/generic/004.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)tests/generic/004 +1
-1@@ -58,7 +58,7 @@ $XFS_IO_PROG -T \ rm ${testfile} # test creating a r/o tmpfile. Should fail -$XFS_IO_PROG -Tr ${TEST_DIR} -c "close" | _filter_test_dir +$XFS_IO_PROG -Tr ${TEST_DIR} -c "close" 2>&1 | _filter_test_dir # success, all done status=0tests/generic/004.out +1
-1@@ -3,4 +3,4 @@ wrote 4096/4096 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 4096/4096 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -/mnt/test: Invalid argument +TEST_DIR: Invalid argument
Theodore Ts'o
maintainerPATCH 2/3 generic/022: update expected output after the test was renamed
In reply to Theodore Ts'oAfter generic/022 was renamed by commit 21723cdb, the wrong test number was put into generic/022.out. Fix this.
--- tests/generic/022.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/022.out +1 -1
@@ -1,4 +1,4 @@ -QA output created by 009 +QA output created by 022 1. into a hole f4f35d60b3cc18aaa6d8d92f0cd3708a 2. into allocated space
Signature · 1 line
1.9.0
Re: [PATCH 2/3] generic/022: update expected output after the test was renamed
Quoted 5 lines · Theodore Ts'o
After generic/022 was renamed by commit
21723cdb, the wrong test number was put into generic/022.out. Fix this.Signed-off-by "Theodore Ts'o" <[email protected]>Cc Lukas Czerner <[email protected]>
Lukas sent this a couple days ago as well.
In any case, again, Reviewed-by: Eric Sandeen <[email protected]>
Quoted 15 lines
--- tests/generic/022.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/generic/022.out +1
-1@@ -1,4 +1,4 @@ -QA output created by 009 +QA output created by 022 1. into a hole f4f35d60b3cc18aaa6d8d92f0cd3708a 2. into allocated space
Theodore Ts'o
maintainerPATCH 3/3 generic/237: fix filtering for expected failure message
In reply to Theodore Ts'oNewer kernels return EACCES instead of EPERM when modifying an acl fails. Update the filtering to handle this.
--- tests/generic/237 | 2 +- tests/generic/237.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tests/generic/237 +1 -1
@@ -68,7 +68,7 @@ touch file1 chown $acl1.$acl1 file1 echo "Expect to FAIL" -$runas -u $acl2 -g $acl2 -- `which setfacl` -m u::rwx file1 2>&1 | sed 's/^setfacl: \/.*file1: Operation not permitted$/setfacl: file1: Operation not permitted/' +$runas -u $acl2 -g $acl2 -- `which setfacl` -m u::rwx file1 2>&1 | sed -e 's/Permission denied/Operation not permitted/' -e 's/file1: //' -e 's,[/a-zA-Z]*setfacl: ,setfacl: ,' echo "Test over." # success, all done
tests/generic/237.out +1 -1
@@ -1,4 +1,4 @@ QA output created by 237 Expect to FAIL -setfacl: file1: Operation not permitted +setfacl: Operation not permitted Test over.
Signature · 6 lines
1.9.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 3/3] generic/237: fix filtering for expected failure message
Quoted 4 lines · Theodore Ts'o
Newer kernels return EACCES instead of EPERM when modifying an acl fails. Update the filtering to handle this.
Signed-off-by "Theodore Ts'o" <[email protected]>
I've not seen this yet. What exact configuration do you use to get the error?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Theodore Ts'o
maintainerRe: [PATCH 3/3] generic/237: fix filtering for expected failure message
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Theodore Ts'o
Newer kernels return EACCES instead of EPERM when modifying an acl fails. Update the filtering to handle this.
Signed-off-by "Theodore Ts'o" <[email protected]>I've not seen this yet. What exact configuration do you use to get the error?
I was using a 32-bit kernel, using a recent Linus upstream. The bug was showing up for both ext4 and xfs, and xfstests-bld is using a very recent version of the acl package?
If you're not seeing it, perhaps the most likely cause would be the fact that I was using an i386 kernel, and/or the version of the acl userspace package found in kvm-xfstests?
If you want a repro, you could grab:
git://git.kernel.org/pub/scm/fs/ext2/xfstests-bld.git
and then building the per the README.
If you don't have a Debian testing system conviently to hand, you could pull down:
https://www.kernel.org/pub/linux/kernel/people/tytso/kvm-xfstests/root_fs.img.i386
... and then update the image to have the xfstests upstream version of /root/xfstests/tests/generic/237*.
Cheers,
- Ted
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 3/3] generic/237: fix filtering for expected failure message
In reply to Theodore Ts'oQuoted 14 lines · Theodore Ts'o
Newer kernels return EACCES instead of EPERM when modifying an acl fails. Update the filtering to handle this.
Signed-off-by "Theodore Ts'o" <[email protected]>--- tests/generic/237 | 2 +- tests/generic/237.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)tests/generic/237 +0
-0
tests/generic/237 touch file1 · line 71
Quoted 5 lines
tests/generic/237 +1
-1@@ -68,7 +68,7 @@ touch file1 chown $acl1.$acl1 file1 echo "Expect to FAIL" -$runas -u $acl2 -g $acl2 -- `which setfacl` -m u::rwx file1 2>&1 | sed 's/^setfacl: \/.*file1: Operation not permitted$/setfacl: file1: Operation not permitted/' +$runas -u $acl2 -g $acl2 -- `which setfacl` -m u::rwx file1 2>&1 | sed -e 's/Permission denied/Operation not permitted/' -e 's/file1: //' -e 's,[/a-zA-Z]*setfacl: ,setfacl: ,'
This is getting unweildy. Can you factor this into a local _filter_setfacl_error function of some kind? It would also help if you put a comment iterating all the different output formats it's now trying to filter out, too.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Theodore Ts'o
maintainerRe: [PATCH 3/3] generic/237: fix filtering for expected failure message
After looking at this more closely, this patch isn't needed. It was a configuration screw up on my end.
- Ted
Theodore Ts'o
maintainerQuoted 4 lines · Theodore Ts'o
To avoid potential data races, use a spinlock which protects the raw (on-disk) inode.
Signed-off-by "Theodore Ts'o" <[email protected]>
Sigh, sorry, left over patch in the /tmp/p directory. Please ignore....
- Ted