Skip to content

client: Fix leading / issue with mds_check_access - #58878

Merged
vshankar merged 2 commits into
ceph:mainfrom
kotreshhr:fuse-mds-auth-caps-issue
Jul 31, 2024
Merged

vshankar merged 2 commits into
ceph:mainfrom
kotreshhr:fuse-mds-auth-caps-issue

Conversation

@kotreshhr

@kotreshhr kotreshhr commented Jul 26, 2024 •

Copy link
Copy Markdown
Contributor

The "Client::mds_check_access" expects the target_path without leading '/' as it eventually calls the "MDSCapMatch::match_path" which expects the target_path passed to be with out leading '/' as well.

The single leading '/' was being removed. But absolute path constructed did have leading '//', so removing all the leading '/' was necessary.

This causes the clients not to be able to access a particular path even though it has a rw permission on the specific path.

The patches fixes the leading '//' issue.

Fixes: https://tracker.ceph.com/issues/67212

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@kotreshhr
kotreshhr requested review from a team and batrick July 26, 2024 15:01
@github-actions github-actions Bot added the cephfs Ceph File System label Jul 26, 2024
@kotreshhr
kotreshhr requested a review from vshankar July 26, 2024 15:01
@kotreshhr

Copy link
Copy Markdown
Contributor Author

I need to add a test for this.

@kotreshhr
kotreshhr force-pushed the fuse-mds-auth-caps-issue branch from 2a8c6e8 to f00af71 Compare July 26, 2024 15:06
Comment thread src/client/Client.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about having this is mds_check_access() itself?

Comment thread src/client/Client.cc Resolved
@kotreshhr
kotreshhr force-pushed the fuse-mds-auth-caps-issue branch from f00af71 to 9a7693f Compare July 28, 2024 19:02
@github-actions github-actions Bot added the tests label Jul 28, 2024
@kotreshhr

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@kotreshhr
kotreshhr force-pushed the fuse-mds-auth-caps-issue branch from 9a7693f to 5eb4f6b Compare July 28, 2024 19:09
@kotreshhr kotreshhr changed the title client: Fix path argument to mds_check_access client: Fix leading / issue with mds_check_access Jul 28, 2024
Comment thread src/client/Client.cc Resolved
Comment thread src/client/Client.cc Resolved

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise lgtm

Comment thread qa/tasks/cephfs/test_admin.py Resolved
Comment thread src/client/Client.cc Resolved
@vshankar

Copy link
Copy Markdown
Contributor

@kotreshhr

Copy link
Copy Markdown
Contributor Author

@kotreshhr
kotreshhr force-pushed the fuse-mds-auth-caps-issue branch 2 times, most recently from 711a9d4 to 26a2f6b Compare July 30, 2024 12:50
@kotreshhr

Copy link
Copy Markdown
Contributor Author

I see a test failure on my run https://pulpito.ceph.com/khiremat-2024-07-30_06:33:39-fs:functional-wip-khiremat-58878-use-mds-auth-caps-issue-0-distro-default-smithi/

Investigating. I will update on findings.

It was a test bug. The new_file creation path was in correct w.r.t the mountpoint. Fixed that.

@kotreshhr
kotreshhr force-pushed the fuse-mds-auth-caps-issue branch 3 times, most recently from db90f1f to a40b089 Compare July 30, 2024 15:35
The "Client::mds_check_access" expects the target_path without
leading '/' as it eventually calls the "MDSCapMatch::match_path"
which expects the target_path passed to be with out leading '/'
as well.

The single leading '/' was being removed. But absolute path
constructed did have leading '//', so removing all the leading
'/' was necessary.

This causes the clients not to be able to access a particular
path even though it has a rw permission on the specific path.

The patche fixes the leading '//' issue.

Fixes: https://tracker.ceph.com/issues/67212
Signed-off-by: Kotresh HR <[email protected]>
@kotreshhr
kotreshhr force-pushed the fuse-mds-auth-caps-issue branch from a40b089 to 2e2adb2 Compare July 30, 2024 17:49
@kotreshhr

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/khiremat-2024-07-30_17:58:55-fs:functional-wip-khiremat-58878-use-mds-auth-caps-issue-0-distro-default-smithi/

The test has passed. But there is different warning not related to test. See below.

[khiremat@vossi04 7826702]$ egrep " cmd on a specific path|cephfs_test_runner*.*test_fs_read_and_single_path_rw" teuthology.log  
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:Starting test: test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
Tests the file creation using 'touch' cmd on a specific path
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
2024-07-30T20:25:25.868 INFO:tasks.cephfs_test_runner:Tests the file creation using 'touch' cmd on a specific path ... ok
[khiremat@vossi04 7826702]$ 

@kotreshhr

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@vshankar

Copy link
Copy Markdown
Contributor

https://pulpito.ceph.com/khiremat-2024-07-30_17:58:55-fs:functional-wip-khiremat-58878-use-mds-auth-caps-issue-0-distro-default-smithi/

The test has passed. But there is different warning not related to test. See below.

[khiremat@vossi04 7826702]$ egrep " cmd on a specific path|cephfs_test_runner*.*test_fs_read_and_single_path_rw" teuthology.log  
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:Starting test: test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
Tests the file creation using 'touch' cmd on a specific path
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
2024-07-30T20:25:25.868 INFO:tasks.cephfs_test_runner:Tests the file creation using 'touch' cmd on a specific path ... ok
[khiremat@vossi04 7826702]$ 

Sorry, what warning?

vshankar added a commit to vshankar/ceph that referenced this pull request Jul 31, 2024
* refs/pull/58878/head:
	client: Fix leading / issue with mds_check_access
	qa: Add mds caps test for testing fs read and a path rw

Reviewed-by: Xiubo Li <[email protected]>
Reviewed-by: Patrick Donnelly <[email protected]>
Reviewed-by: Venky Shankar <[email protected]>
@kotreshhr

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/khiremat-2024-07-30_17:58:55-fs:functional-wip-khiremat-58878-use-mds-auth-caps-issue-0-distro-default-smithi/
The test has passed. But there is different warning not related to test. See below.

[khiremat@vossi04 7826702]$ egrep " cmd on a specific path|cephfs_test_runner*.*test_fs_read_and_single_path_rw" teuthology.log  
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:Starting test: test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
Tests the file creation using 'touch' cmd on a specific path
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
2024-07-30T20:25:25.868 INFO:tasks.cephfs_test_runner:Tests the file creation using 'touch' cmd on a specific path ... ok
[khiremat@vossi04 7826702]$ 

Sorry, what warning?

"2024-07-30T21:00:20.005629+0000 mds.a (mds.0) 1 : cluster [WRN] client could not reconnect as file system flag refuse_client_session is set" in cluster log

@vshankar

Copy link
Copy Markdown
Contributor

https://pulpito.ceph.com/khiremat-2024-07-30_17:58:55-fs:functional-wip-khiremat-58878-use-mds-auth-caps-issue-0-distro-default-smithi/
The test has passed. But there is different warning not related to test. See below.

[khiremat@vossi04 7826702]$ egrep " cmd on a specific path|cephfs_test_runner*.*test_fs_read_and_single_path_rw" teuthology.log  
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:Starting test: test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
Tests the file creation using 'touch' cmd on a specific path
2024-07-30T20:23:41.232 INFO:tasks.cephfs_test_runner:test_fs_read_and_single_path_rw (tasks.cephfs.test_admin.TestFsAuthorize)
2024-07-30T20:25:25.868 INFO:tasks.cephfs_test_runner:Tests the file creation using 'touch' cmd on a specific path ... ok
[khiremat@vossi04 7826702]$ 

Sorry, what warning?

"2024-07-30T21:00:20.005629+0000 mds.a (mds.0) 1 : cluster [WRN] client could not reconnect as file system flag refuse_client_session is set" in cluster log

That's a known issue - https://tracker.ceph.com/issues/66639

@kotreshhr

Copy link
Copy Markdown
Contributor Author

jenkins test docs

@kotreshhr

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@kotreshhr

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

vshankar added a commit to vshankar/ceph that referenced this pull request Jul 31, 2024
* refs/pull/58878/head:
	client: Fix leading / issue with mds_check_access
	qa: Add mds caps test for testing fs read and a path rw

Reviewed-by: Patrick Donnelly <[email protected]>
Reviewed-by: Xiubo Li <[email protected]>
Reviewed-by: Venky Shankar <[email protected]>
@vshankar

Copy link
Copy Markdown
Contributor

https://pulpito.ceph.com/vshankar-2024-07-31_07:55:21-fs-wip-vshankar-testing-20240730.074544-debug-testing-default-smithi/

The above run is with --filter admin. That should be good enough to merge this patch given its urgency. Will run fs suite run in parallel.

@vshankar

Copy link
Copy Markdown
Contributor

Oh, these unrelated jenkins failures are annoying.

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test make check

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test windows

1 similar comment
@kotreshhr

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From /a/vshankar-2024-07-31_07:55:21-fs-wip-vshankar-testing-20240730.074544-debug-testing-default-smithi/7828173 (which is still running)

2024-07-31T08:48:19.401 INFO:tasks.cephfs_test_runner:Tests the file creation using 'touch' cmd on a specific path ... ok

The test has passed. I'm comfortable merging this change albeit prematurely.

@vshankar

vshankar commented Aug 6, 2024

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants