Skip to contentSkip to conversation

ceph: don't run tests if we can't set a custom layout

PATCH In review Jeff Layton 3 participants 4 messages Dec 7, 2021 – Dec 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: don't run tests if we can't set a custom layout

Some of the coming fscrypt patches prohibit non-default layout changes. Skip running the tests that set custom layouts if setting the layout fails.

Cc Luis Henriques <[email protected]>
---
 common/ceph | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/ceph +1 -1
index ca756dda8dd3..31b169af51b8 100644
@@ -19,7 +19,7 @@ _ceph_create_file_layout()
 	touch $fname
 	$SETFATTR_PROG -n ceph.file.layout \
 		-v "stripe_unit=$objsz stripe_count=1 object_size=$objsz" \
-		$fname
+		$fname || _notrun "setting ceph.file.layout failed"
 }
 
 # this test requires to access file capabilities through vxattr 'ceph.caps'.
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Jeff Layton

Some of the coming fscrypt patches prohibit non-default layout changes. Skip running the tests that set custom layouts if setting the layout fails.

Cc Luis Henriques <[email protected]>
---
 common/ceph | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/ceph +1 -1
index ca756dda8dd3..31b169af51b8 100644
@@ -19,7 +19,7 @@ _ceph_create_file_layout()
 	touch $fname
 	$SETFATTR_PROG -n ceph.file.layout \
 		-v "stripe_unit=$objsz stripe_count=1 object_size=$objsz" \
-		$fname
+		$fname || _notrun "setting ceph.file.layout failed"
 }
 
 # this test requires to access file capabilities through vxattr 'ceph.caps'.
Signature · 1 line
2.33.1

Yeah, this is a simple way to skip those tests. Feel free to add my

Cheers,
--
Luís

#2 lore raw
In reply to Jeff Layton
Quoted 14 lines · Jeff Layton

Some of the coming fscrypt patches prohibit non-default layout changes. Skip running the tests that set custom layouts if setting the layout fails.

Cc Luis Henriques <[email protected]>
---
 common/ceph | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/ceph +0 -0
index ca756dda8dd3..31b169af51b8 100644

common/ceph _ceph_create_file_layout() · line 23

Quoted 6 lines
common/ceph +1 -1
@@ -19,7 +19,7 @@ _ceph_create_file_layout()
 	touch $fname
 	$SETFATTR_PROG -n ceph.file.layout \
 		-v "stripe_unit=$objsz stripe_count=1 object_size=$objsz" \
-		$fname
+		$fname || _notrun "setting ceph.file.layout failed"
 }

IMO _ceph_create_file_layout() is a helper function that does the real work, i.e. either prepares the test or does the test, not a function to check if current env & setup meets what the test needs.

So I think it's better to check the ability to change layout explicitly in a new _require rule. e.g. something like _require_ceph_change_layout?

Thanks,
Eryu

Quoted 4 lines
common/ceph +0 -0
 # this test requires to access file capabilities through vxattr 'ceph.caps'.
Signature · 1 line
2.33.1
#3 lore raw
Quoted 26 lines · Eryu Guan
Quoted 14 lines · Jeff Layton

Some of the coming fscrypt patches prohibit non-default layout changes. Skip running the tests that set custom layouts if setting the layout fails.

Cc Luis Henriques <[email protected]>
---
 common/ceph | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/ceph +0 -0
index ca756dda8dd3..31b169af51b8 100644

common/ceph _ceph_create_file_layout() · line 23

Quoted 6 lines
common/ceph +1 -1
@@ -19,7 +19,7 @@ _ceph_create_file_layout()
 	touch $fname
 	$SETFATTR_PROG -n ceph.file.layout \
 		-v "stripe_unit=$objsz stripe_count=1 object_size=$objsz" \
-		$fname
+		$fname || _notrun "setting ceph.file.layout failed"
 }

IMO _ceph_create_file_layout() is a helper function that does the real work, i.e. either prepares the test or does the test, not a function to check if current env & setup meets what the test needs.

Quoted 5 lines

So I think it's better to check the ability to change layout explicitly in a new _require rule. e.g. something like _require_ceph_change_layout?

Thanks,
Eryu

Good point. OTOH, relying on this program returning an error may be the wrong approach. What might be best is to just have a _require_not_encrypted check. That might be more universally useful anyway.

Let me see what I can come up with. We can drop this patch for now.

Thanks!

Signature · 1 line
Jeff Layton <[email protected]>