[LU-12349] print error to console when flock() is diabled Created: 28/May/19  Updated: 28/Jun/19  Resolved: 28/Jun/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.13.0

Type: Improvement Priority: Minor
Reporter: Li Xi Assignee: Li Xi
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates LU-12348 "flock" mount option should be enable... Closed
Rank (Obsolete): 9223372036854775807

 Description   

1) Console message like "flock disabled, mount with '-o flock' to enable" instead of just returning -EOPNOTSUPP.

2) Console message like "Lustre doesn't support mandatory POSIX file lock" when an application tries to lock file with S_ISGID and without S_IXGRP.



 Comments   
Comment by Gerrit Updater [ 29/May/19 ]

Li Xi (lixi@ddn.com) uploaded a new patch: https://review.whamcloud.com/34986
Subject: LU-12349 llite: console message for disabled flock call
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 87cbba184880b60654c61c5dbecfee931e9d2452

Comment by Li Xi [ 29/May/19 ]

With the patch, error message would be able to printed to console:

[root@server17-el7-vm4 lustre-release.git]# mount | grep global
10.0.1.148@tcp:/global on /mnt type lustre (rw,lazystatfs)
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat
flock disabled, mount with '-o [local]flock' to enable
flock: /mnt/first_file: Function not implemented
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
flock disabled, mount with '-o [local]flock' to enable
Comment by Li Xi [ 29/May/19 ]

With the second version of the patch, the message rate is limited with the same mechanism of CDBUG.

[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
flock disabled, mount with '-o [local]flock' to enable
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
flock disabled, mount with '-o [local]flock' to enable
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
[root@server17-el7-vm4 lustre-release.git]# flock /mnt/first_file -c cat > /tmp/log 2>&1
flock disabled, mount with '-o [local]flock' to enable
Skipped 6 previous similar messages
Comment by Gerrit Updater [ 28/Jun/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34986/
Subject: LU-12349 llite: console message for disabled flock call
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: f6497eb3503b7efff823888ed76422db4e9e078e

Comment by Peter Jones [ 28/Jun/19 ]

Landed for 2.13

Generated at Sat Feb 10 02:51:48 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.