Whamcloud - gitweb
LU-930 misc: limit CDEBUG console message frequency
[fs/lustre-release.git] / lustre / llite / file.c
index e0a902a..3871c89 100644 (file)
@@ -324,8 +324,9 @@ static int ll_md_close(struct inode *inode, struct file *file)
                /* Usually the lease is not released when the
                 * application crashed, we need to release here. */
                rc = ll_lease_close(fd->fd_lease_och, inode, &lease_broken);
-               CDEBUG(rc ? D_ERROR : D_INODE, "Clean up lease "DFID" %d/%d\n",
-                       PFID(&lli->lli_fid), rc, lease_broken);
+               CDEBUG_LIMIT(rc ? D_ERROR : D_INODE,
+                            "Clean up lease "DFID" %d/%d\n",
+                            PFID(&lli->lli_fid), rc, lease_broken);
 
                fd->fd_lease_och = NULL;
        }
@@ -3481,6 +3482,7 @@ static long ll_file_unlock_lease(struct file *file, struct ll_ioc_lease *ioc,
                if (!layout_file)
                        GOTO(out_lease_close, rc = -EBADF);
 
+               /* if layout_file == file, it means to destroy the mirror */
                sp.sp_inode = file_inode(layout_file);
                sp.sp_mirror_id = (__u16)mirror_id;
                data = &sp;
@@ -3810,7 +3812,10 @@ out:
 
                 RETURN(0);
         }
+       case OBD_IOC_GETNAME_OLD:
+               /* fall through */
        case OBD_IOC_GETDTNAME:
+               /* fall through */
        case OBD_IOC_GETMDNAME:
                RETURN(ll_get_obd_name(inode, cmd, arg));
        case LL_IOC_HSM_STATE_GET: {
@@ -5148,11 +5153,6 @@ int cl_falloc(struct inode *inode, int mode, loff_t offset, loff_t len)
                        rc = -EFBIG;
                        goto out;
                }
-               io->u.ci_setattr.sa_attr.lvb_size = sa_falloc_end;
-               if (!(mode & FALLOC_FL_KEEP_SIZE))
-                       io->u.ci_setattr.sa_avalid |= ATTR_SIZE;
-       } else {
-               io->u.ci_setattr.sa_attr.lvb_size = size;
        }
 
 again:
@@ -5262,7 +5262,6 @@ int ll_inode_permission(struct inode *inode, int mask)
        struct root_squash_info *squash;
        struct cred *cred = NULL;
        const struct cred *old_cred = NULL;
-       cfs_cap_t cap;
        bool squash_id = false;
        ktime_t kstart = ktime_get();
 
@@ -5306,10 +5305,9 @@ int ll_inode_permission(struct inode *inode, int mask)
 
                cred->fsuid = make_kuid(&init_user_ns, squash->rsi_uid);
                cred->fsgid = make_kgid(&init_user_ns, squash->rsi_gid);
-               for (cap = 0; cap < sizeof(cfs_cap_t) * 8; cap++) {
-                       if (BIT(cap) & CFS_CAP_FS_MASK)
-                               cap_lower(cred->cap_effective, cap);
-               }
+               cred->cap_effective = cap_drop_nfsd_set(cred->cap_effective);
+               cred->cap_effective = cap_drop_fs_set(cred->cap_effective);
+
                old_cred = override_creds(cred);
        }