ptlrpc_req_finished(req);
ll_intent_drop_lock(itp);
+ /* We did open by fid, but by the time we got to the server,
+ * the object disappeared. If this is a create, we cannot really
+ * tell the userspace that the file it was trying to create
+ * does not exist. Instead let's return -ESTALE, and the VFS will
+ * retry the create with LOOKUP_REVAL that we are going to catch
+ * in ll_revalidate_dentry() and use lookup then.
+ */
+ if (rc == -ENOENT && itp->it_op & IT_CREAT)
+ rc = -ESTALE;
+
RETURN(rc);
}
if (it.it_lock_mode == 0 ||
it.it_lock_bits != MDS_INODELOCK_OPEN) {
/* open lock must return for lease */
- CERROR(DFID "lease granted but no open lock, %d/"LPU64".\n",
+ CERROR(DFID "lease granted but no open lock, %d/%llu.\n",
PFID(ll_inode2fid(inode)), it.it_lock_mode,
it.it_lock_bits);
GOTO(out_close, rc = -EPROTO);
if (mtime < attr->cat_mtime)
mtime = attr->cat_mtime;
- CDEBUG(D_VFSTRACE, DFID" updating i_size "LPU64"\n",
+ CDEBUG(D_VFSTRACE, DFID" updating i_size %llu\n",
PFID(&lli->lli_fid), attr->cat_size);
i_size_write(inode, attr->cat_size);
ENTRY;
- CDEBUG(D_VFSTRACE, "file: %s, type: %d ppos: "LPU64", count: %zu\n",
+ CDEBUG(D_VFSTRACE, "file: %s, type: %d ppos: %llu, count: %zu\n",
file_dentry(file)->d_name.name, iot, *ppos, count);
restart:
* much more data being sent to the client.
*/
static int ll_ladvise(struct inode *inode, struct file *file, __u64 flags,
- struct lu_ladvise *ladvise)
+ struct llapi_lu_ladvise *ladvise)
{
struct lu_env *env;
struct cl_io *io;
RETURN(ll_file_futimes_3(file, &lfu));
}
case LL_IOC_LADVISE: {
- struct ladvise_hdr *ladvise_hdr;
+ struct llapi_ladvise_hdr *ladvise_hdr;
int i;
int num_advise;
int alloc_size = sizeof(*ladvise_hdr);
RETURN(-ENOMEM);
if (copy_from_user(ladvise_hdr,
- (const struct ladvise_hdr __user *)arg,
+ (const struct llapi_ladvise_hdr __user *)arg,
alloc_size))
GOTO(out_ladvise, rc = -EFAULT);
* TODO: submit multiple advices to one server in a single RPC
*/
if (copy_from_user(ladvise_hdr,
- (const struct ladvise_hdr __user *)arg,
+ (const struct llapi_ladvise_hdr __user *)arg,
alloc_size))
GOTO(out_ladvise, rc = -EFAULT);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
- CDEBUG(D_DLMTRACE, "inode="DFID", pid=%u, flags="LPX64", mode=%u, "
- "start="LPU64", end="LPU64"\n", PFID(ll_inode2fid(inode)),
+ CDEBUG(D_DLMTRACE, "inode="DFID", pid=%u, flags=%#llx, mode=%u, "
+ "start=%llu, end=%llu\n", PFID(ll_inode2fid(inode)),
flock.l_flock.pid, flags, einfo.ei_mode,
flock.l_flock.start, flock.l_flock.end);