Description: peer credits not enough on many OST per OSS systems.
Details : Use new lnet way to add credits as we need those for pings and ASTs
+Severity : minor
+Bugzilla : 12790
+Frequency : only with liblustre
+Description: Liblustre is not releasing flock locks on file close.
+Details : Release flock locks on file close.
+
--------------------------------------------------------------------------------
2007-07-30 Cluster File Systems, Inc. <info@clusterfs.com>
int llu_iop_close(struct inode *inode)
{
int rc;
+ struct ldlm_res_id res_id =
+ { .name = {llu_i2stat(inode)->st_ino,
+ (__u64)llu_i2info(inode)->lli_st_generation, LDLM_FLOCK} };
+ struct lustre_handle lockh = {0};
liblustre_wait_event(0);
+ /* If we have posix locks on this file - clear all of those */
+ if (ldlm_lock_match(
+ class_exp2obd(llu_i2mdcexp(inode))->obd_namespace,
+ LDLM_FL_BLOCK_GRANTED|LDLM_FL_TEST_LOCK|LDLM_FL_CBPENDING,
+ &res_id, LDLM_FLOCK, NULL, LCK_PR|LCK_PW, &lockh)) {
+ struct file_lock lock;
+ lock.fl_type = F_UNLCK;
+ lock.fl_flags = FL_POSIX;
+ lock.fl_start = 0;
+ lock.fl_end = OFFSET_MAX;
+ lock.fl_pid = getpid();
+ lock.fl_notify = NULL;
+ lock.fl_insert = NULL;
+ lock.fl_remove = NULL;
+ lock.fl_owner = NULL;
+ lock.fl_file = NULL;
+
+ llu_file_flock(inode, F_SETLK, &lock);
+ }
+
rc = llu_file_release(inode);
if (rc) {
CERROR("file close error %d\n", rc);
struct inode *llu_iget(struct filesys *fs, struct lustre_md *md);
int llu_inode_getattr(struct inode *inode, struct lov_stripe_md *lsm);
int llu_setattr_raw(struct inode *inode, struct iattr *attr);
+int llu_file_flock(struct inode *ino, int cmd, struct file_lock *file_lock);
extern struct fssw_ops llu_fssw_ops;
#define FCNTL_FLMASK_INVALID (O_NONBLOCK|O_ASYNC)
/* refer to ll_file_flock() for details */
-static int llu_file_flock(struct inode *ino,
- int cmd,
- struct file_lock *file_lock)
+int llu_file_flock(struct inode *ino, int cmd, struct file_lock *file_lock)
{
struct llu_inode_info *lli = llu_i2info(ino);
struct intnl_stat *st = llu_i2stat(ino);