Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle missing /etc/mtab and modify output #1514

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

Deixx
Copy link
Contributor

@Deixx Deixx commented Sep 10, 2024

resolves #1515

Output after modifications:

# lsblk
...
vdc          disk
└─cas1-1     disk /tmp/mnt2
vdd          disk
└─cas1-2     disk
  ├─cas1-2p1 part
  ├─cas1-2p2 part /tmp/mnt1
  ├─cas1-2p3 part
  └─cas1-2p4 part /tmp/mnt3
# casadm -L
type    id   disk       status    write policy   device
cache   1    /dev/vdb   Running   wt             -
├core   1    /dev/vdc   Active    -              /dev/cas1-1
└core   2    /dev/vdd   Active    -              /dev/cas1-2
# casadm -T -i 1
Can't stop cache instance 1 due to mounted devices:
/dev/cas1-2p2
/dev/cas1-1
/dev/cas1-2p4
# casadm -R -i 1 -j 1
Can't remove core 1 from cache 1 due to mounted devices:
/dev/cas1-1
# casadm -R -i 1 -j 2
Can't remove core 2 from cache 1 due to mounted devices:
/dev/cas1-2p2
/dev/cas1-2p4

@Deixx Deixx force-pushed the mtab-check-optional branch 7 times, most recently from b243149 to 3872fcc Compare September 12, 2024 13:22
@Deixx Deixx changed the title Mtab check optional Handle missing /etc/mtab and modify output Sep 13, 2024
@Open-CAS Open-CAS deleted a comment from pep8speaks Sep 30, 2024
mmichal10
mmichal10 previously approved these changes Oct 21, 2024
casadm/cas_lib.c Outdated Show resolved Hide resolved
casadm/cas_lib.c Show resolved Hide resolved
casadm/cas_lib.c Show resolved Hide resolved
casadm/cas_lib.c Show resolved Hide resolved
casadm/cas_lib.c Show resolved Hide resolved
casadm/cas_lib.c Show resolved Hide resolved
casadm/cas_lib.c Outdated Show resolved Hide resolved
mmichal10
mmichal10 previously approved these changes Oct 28, 2024
There are situations when /etc/mtab is not present in the
system (e.g. in certain container images). This blocks
stop/remove operations. With making this check optional
the duty of checking mounts falls to kernel.
Test modified to check operations with and without mtab.

Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
Calling functions now print error messages.
All the mounted devices are printed (not just the first one).

Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
@robertbaldyga robertbaldyga merged commit e8b1c3c into Open-CAS:master Oct 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[casadm] Better error messages for operations blocked by mounted cores
4 participants