X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fllite%2Ffile.c;h=4ca1911a0d860451f62e27f33fbf61ee97d371a0;hp=c186b5a20cd8ad712eba620c1dd2af77ddc9d78e;hb=71535dbbb89774eecb2f83eff80b19515e14da70;hpb=86b2211e55dcc509da85b21ece8830e2a9b70db1 diff --git a/lustre/llite/file.c b/lustre/llite/file.c index c186b5a..4ca1911 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -2022,6 +2022,16 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock) } flock.l_flock.pid = file_lock->fl_pid; + /* Somewhat ugly workaround for svc lockd. + * lockd installs custom fl_lmops->fl_compare_owner that checks + * for the fl_owner to be the same (which it always is on local node + * I guess between lockd processes) and then compares pid. + * As such we assign pid to the owner field to make it all work, + * conflict with normal locks is unlikely since pid space and + * pointer space for current->files are not intersecting */ + if (file_lock->fl_lmops && file_lock->fl_lmops->fl_compare_owner) + flock.l_flock.owner = (unsigned long)file_lock->fl_pid; + switch (file_lock->fl_type) { case F_RDLCK: einfo.ei_mode = LCK_PR;