struct lustre_handle lockh = {0};
ldlm_policy_data_t flock;
int flags = 0;
- int rc;
+ int rc, rc2 = 0;
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu file_lock=%p\n",
&flock, &flags, NULL, 0, NULL, &lockh, 0);
if ((file_lock->fl_flags & FL_FLOCK) &&
(rc == 0 || file_lock->fl_type == F_UNLCK))
- ll_flock_lock_file_wait(file, file_lock, (cmd == F_SETLKW));
+ rc2 = ll_flock_lock_file_wait(file, file_lock, (cmd == F_SETLKW));
#ifdef HAVE_F_OP_FLOCK
if ((file_lock->fl_flags & FL_POSIX) &&
(rc == 0 || file_lock->fl_type == F_UNLCK) &&
!(flags & LDLM_FL_TEST_LOCK))
- posix_lock_file_wait(file, file_lock);
+ rc2 = posix_lock_file_wait(file, file_lock);
#endif
- RETURN(rc);
+ RETURN(rc ? rc : rc2);
}
int ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)