*
  * Returns 0 if caps were not able to be acquired (yet), 1 if succeed,
  * or a negative error code. There are 3 speical error codes:
- *  -EAGAIN: need to sleep but non-blocking is specified
- *  -EFBIG:  ask caller to call check_max_size() and try again.
- *  -ESTALE: ask caller to call ceph_renew_caps() and try again.
+ *  -EAGAIN:  need to sleep but non-blocking is specified
+ *  -EFBIG:   ask caller to call check_max_size() and try again.
+ *  -EUCLEAN: ask caller to call ceph_renew_caps() and try again.
  */
 enum {
        /* first 8 bits are reserved for CEPH_FILE_MODE_FOO */
                        dout("get_cap_refs %p endoff %llu > maxsize %llu\n",
                             inode, endoff, ci->i_max_size);
                        if (endoff > ci->i_requested_max_size)
-                               ret = ci->i_auth_cap ? -EFBIG : -ESTALE;
+                               ret = ci->i_auth_cap ? -EFBIG : -EUCLEAN;
                        goto out_unlock;
                }
                /*
                        dout("get_cap_refs %p need %s > mds_wanted %s\n",
                             inode, ceph_cap_string(need),
                             ceph_cap_string(mds_wanted));
-                       ret = -ESTALE;
+                       ret = -EUCLEAN;
                        goto out_unlock;
                }
 
 
        ret = try_get_cap_refs(inode, need, want, 0, flags, got);
        /* three special error codes */
-       if (ret == -EAGAIN || ret == -EFBIG || ret == -ESTALE)
+       if (ret == -EAGAIN || ret == -EFBIG || ret == -EUCLEAN)
                ret = 0;
        return ret;
 }
                }
 
                if (ret < 0) {
-                       if (ret == -EFBIG || ret == -ESTALE) {
+                       if (ret == -EFBIG || ret == -EUCLEAN) {
                                int ret2 = ceph_wait_on_async_create(inode);
                                if (ret2 < 0)
                                        return ret2;
                                check_max_size(inode, endoff);
                                continue;
                        }
-                       if (ret == -ESTALE) {
+                       if (ret == -EUCLEAN) {
                                /* session was killed, try renew caps */
                                ret = ceph_renew_caps(inode, flags);
                                if (ret == 0)