23.07.2014 Views

Lustre 1.6 Operations Manual

Lustre 1.6 Operations Manual

Lustre 1.6 Operations Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

32.5.7 Flock Feature<br />

<strong>Lustre</strong> now includes the flock feature, which provides file locking support. Flock<br />

describes classes of file locks known as ‘flocks’. Flock can apply or remove a lock on<br />

an open file as specified by the user. However, a single file may not, simultaneously,<br />

have both shared and exclusive locks.<br />

By default, the flock utility is disabled on <strong>Lustre</strong>. Two modes are available.<br />

local mode<br />

consistent mode<br />

In this mode, locks are coherent on a node (a single-node flock), but not<br />

across all clients. To enable it, use -o localflock.<br />

This is a client-mount option.<br />

In this mode, locks are coherent across all clients.<br />

To enable it, use the -o flock. This is a client-mount option.<br />

CAUTION: This mode has a noticeable performance impact and may<br />

affect stability, depending on the <strong>Lustre</strong> version used. Consider using a<br />

newer <strong>Lustre</strong> version which is more stable.<br />

A call to use flock may be blocked if another process is holding an incompatible<br />

lock. Locks created using flock are applicable for an open file table entry. Therefore,<br />

a single process may hold only one type of lock (shared or exclusive) on a single file.<br />

Subsequent flock calls on a file that is already locked converts the existing lock to the<br />

new lock mode.<br />

32.5.7.1 Example<br />

$ mount -t lustre –o flock mds@tcp0:/lustre /mnt/client<br />

You can check it in /etc/mtab. It should look like,<br />

mds@tcp0:/lustre /mnt/client lustre rw,flock 00<br />

Chapter 32 System Configuration Utilities (man8) 32-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!