cea-hpc / shine

Lustre administration tool
GNU General Public License v2.0
22 stars 9 forks source link

wrong stop action rc when a target is mounted twice #186

Closed degremont closed 7 years ago

degremont commented 9 years ago

When a target is also mounted as ldiskfs, a shine stop action to this target leads to incoherent return code (0), the ldiskfs mount point is dismounted but the lustre one is still online (stop output result is correct in that sense).

In case of multi-mounted target, we should detect it, either: dismount all associated mount points (probably the best way?), or at last return an unexpected rc for stop as the lustre target is still mounted.

[root@node1 ~] # shine status -f bwork
= FILESYSTEM STATUS (bwork) =
TYPE  # STATUS  NODES
----  - ------  -----
MGT   1 online  node115
MDT   1 online  node115
OST  48 online  node[124-127]
CLI   1 mounted node12

[root@node1 ~] # ssh node115
[root@node115 ~] # df
/dev/sdb1                 54420      6924      44688  14% /mnt/bwork/mgt
/dev/sdb2             365364336  36043708  304958460  11% /mnt/bwork/mdt/0

[root@node115 ~] # mkdir /mnt/ldiskfs
[root@node115 ~] # mount -t ldiskfs /dev/sdb1 /mnt/ldiskfs
[root@node115 ~] # df
Filesystem            1K-blocks      Used  Available Use% Mounted on
/dev/sdb1                 54420      6924      44688  14% /mnt/bwork/mgt
/dev/sdb2             365364336  36043708  304958460  11% /mnt/bwork/mdt/0
/dev/sdb1                 54420      6924      44688  14% /mnt/ldiskfs

[root@node115 ~] # shine status -f bwork -t mgt -L
Status of MGS (/dev/sdb1) ...
Status of MGS (/dev/sdb1) succeeded
= FILESYSTEM STATUS (bwork) =
TYPE # STATUS NODES
---- - ------ -----
MGT  1 online node115

[root@node115 ~] # shine stop -f bwork -t mgt -L
Stop of MGS (/dev/sdb1) ...
Stop of MGS (/dev/sdb1) succeeded (0.0 sec)
Stop successful.
= FILESYSTEM STATUS (bwork) =
TYPE # STATUS NODES
---- - ------ -----
MGT  1 online node115

[root@node115 ~] # echo $?
0

[root@node115 ~] # df
Filesystem            1K-blocks      Used  Available Use% Mounted on
/dev/sdb1                 54420      6924      44688  14% /mnt/bwork/mgt
/dev/sdb2             365364336  36043708  304958460  11% /mnt/bwork/mdt/0

Reported by: thiell

degremont commented 9 years ago

Original comment by: thiell

degremont commented 9 years ago

Original comment by: degremont

degremont commented 9 years ago

Fixed in [f4e89b]

This could be improved later either unmounting using the mount path and/or checking expected state again at ev_close in case of success.

Original comment by: degremont