#include <obd_support.h>
#include <obd_class.h>
#include <uapi/linux/lustre/lustre_ioctl.h>
-#include <uapi/linux/llcrypt.h>
#include <lustre_lib.h>
#include <lustre_dlm.h>
#include <lustre_fid.h>
#include <lustre_kernelcomm.h>
#include <lustre_swab.h>
+#include <libcfs/libcfs_crypto.h>
#include "llite_internal.h"
*
*/
struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data,
- __u64 offset)
+ __u64 offset, int *partial_readdir_rc)
{
- struct md_callback cb_op;
- struct page *page;
- int rc;
+ struct md_readdir_info mrinfo = {
+ .mr_blocking_ast = ll_md_blocking_ast };
+ struct page *page;
+ int rc;
- cb_op.md_blocking_ast = ll_md_blocking_ast;
- rc = md_read_page(ll_i2mdexp(dir), op_data, &cb_op, offset, &page);
+ rc = md_read_page(ll_i2mdexp(dir), op_data, &mrinfo, offset, &page);
if (rc != 0)
return ERR_PTR(rc);
+ if (partial_readdir_rc && mrinfo.mr_partial_readdir_rc)
+ *partial_readdir_rc = mrinfo.mr_partial_readdir_rc;
+
return page;
}
/* Always remove the page for striped dir, because the page is
* built from temporarily in LMV layer */
- if (inode && ll_dir_striped(inode)) {
+ if (inode && S_ISDIR(inode->i_mode) &&
+ lmv_dir_striped(ll_i2info(inode)->lli_lsm_md)) {
__free_page(page);
return;
}
#ifdef HAVE_DIR_CONTEXT
int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
- struct dir_context *ctx)
+ struct dir_context *ctx, int *partial_readdir_rc)
{
#else
int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
- void *cookie, filldir_t filldir)
+ void *cookie, filldir_t filldir, int *partial_readdir_rc)
{
#endif
- struct ll_sb_info *sbi = ll_i2sbi(inode);
- __u64 pos = *ppos;
- bool is_api32 = ll_need_32bit_api(sbi);
- bool is_hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
- struct page *page;
- bool done = false;
- int rc = 0;
+ struct ll_sb_info *sbi = ll_i2sbi(inode);
+ __u64 pos = *ppos;
+ bool is_api32 = ll_need_32bit_api(sbi);
+ bool is_hash64 = test_bit(LL_SBI_64BIT_HASH, sbi->ll_flags);
+ struct page *page;
+ bool done = false;
+ struct llcrypt_str lltr = LLTR_INIT(NULL, 0);
+ int rc = 0;
ENTRY;
- page = ll_get_dir_page(inode, op_data, pos);
+ if (IS_ENCRYPTED(inode)) {
+ rc = llcrypt_fname_alloc_buffer(inode, NAME_MAX, &lltr);
+ if (rc < 0)
+ RETURN(rc);
+ }
+
+ page = ll_get_dir_page(inode, op_data, pos, partial_readdir_rc);
while (rc == 0 && !done) {
struct lu_dirpage *dp;
* for 'filldir()' must be part of the 'ent'. */
#ifdef HAVE_DIR_CONTEXT
ctx->pos = lhash;
- done = !dir_emit(ctx, ent->lde_name, namelen, ino,
- type);
+ if (!IS_ENCRYPTED(inode)) {
+ done = !dir_emit(ctx, ent->lde_name, namelen,
+ ino, type);
+ } else {
+ /* Directory is encrypted */
+ int save_len = lltr.len;
+ struct llcrypt_str de_name =
+ LLTR_INIT(ent->lde_name, namelen);
+
+ rc = ll_fname_disk_to_usr(inode, 0, 0, &de_name,
+ &lltr, &fid);
+ de_name = lltr;
+ lltr.len = save_len;
+ if (rc) {
+ done = 1;
+ break;
+ }
+ done = !dir_emit(ctx, de_name.name, de_name.len,
+ ino, type);
+ }
#else
+ /* HAVE_DIR_CONTEXT is defined from kernel 3.11, whereas
+ * IS_ENCRYPTED is brought by kernel 4.14.
+ * So there is no need to handle encryption case here.
+ */
done = filldir(cookie, ent->lde_name, namelen, lhash,
ino, type);
#endif
le32_to_cpu(dp->ldp_flags) &
LDF_COLLIDE);
next = pos;
- page = ll_get_dir_page(inode, op_data, pos);
+ page = ll_get_dir_page(inode, op_data, pos,
+ partial_readdir_rc);
}
}
#ifdef HAVE_DIR_CONTEXT
#else
*ppos = pos;
#endif
+ llcrypt_fname_free_buffer(&lltr);
RETURN(rc);
}
struct inode *inode = file_inode(filp);
struct ll_file_data *lfd = filp->private_data;
struct ll_sb_info *sbi = ll_i2sbi(inode);
- int hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
+ bool hash64 = test_bit(LL_SBI_64BIT_HASH, sbi->ll_flags);
int api32 = ll_need_32bit_api(sbi);
struct md_op_data *op_data;
struct lu_fid pfid = { 0 };
ktime_t kstart = ktime_get();
+ /* result of possible partial readdir */
+ int partial_readdir_rc = 0;
__u64 pos;
int rc;
+
ENTRY;
- if (lfd != NULL)
- pos = lfd->lfd_pos;
- else
- pos = 0;
+ LASSERT(lfd != NULL);
+ pos = lfd->lfd_pos;
CDEBUG(D_VFSTRACE,
"VFS Op:inode="DFID"(%p) pos/size%lu/%llu 32bit_api %d\n",
PFID(ll_inode2fid(inode)),
inode, (unsigned long)pos, i_size_read(inode), api32);
+ if (IS_ENCRYPTED(inode)) {
+ rc = llcrypt_get_encryption_info(inode);
+ if (rc && rc != -ENOKEY)
+ GOTO(out, rc);
+ }
+
if (pos == MDS_DIR_END_OFF)
/*
* end-of-file.
#ifdef HAVE_DIR_CONTEXT
ctx->pos = pos;
- rc = ll_dir_read(inode, &pos, op_data, ctx);
+ rc = ll_dir_read(inode, &pos, op_data, ctx, &partial_readdir_rc);
pos = ctx->pos;
#else
- rc = ll_dir_read(inode, &pos, op_data, cookie, filldir);
+ rc = ll_dir_read(inode, &pos, op_data, cookie, filldir,
+ &partial_readdir_rc);
#endif
- if (lfd != NULL)
- lfd->lfd_pos = pos;
+ lfd->lfd_pos = pos;
+ if (!lfd->fd_partial_readdir_rc)
+ lfd->fd_partial_readdir_rc = partial_readdir_rc;
if (pos == MDS_DIR_END_OFF) {
if (api32)
},
};
bool encrypt = false;
+ int hash_flags;
int err;
- ENTRY;
+ ENTRY;
if (unlikely(!lmv_user_magic_supported(lump->lum_magic)))
RETURN(-EINVAL);
if (lump->lum_magic != LMV_MAGIC_FOREIGN) {
CDEBUG(D_VFSTRACE,
- "VFS Op:inode="DFID"(%p) name %s stripe_offset %d, stripe_count: %u\n",
+ "VFS Op:inode="DFID"(%p) name=%s stripe_offset=%d stripe_count=%u, hash_type=%x\n",
PFID(ll_inode2fid(parent)), parent, dirname,
- (int)lump->lum_stripe_offset, lump->lum_stripe_count);
+ (int)lump->lum_stripe_offset, lump->lum_stripe_count,
+ lump->lum_hash_type);
} else {
struct lmv_foreign_md *lfm = (struct lmv_foreign_md *)lump;
/* MDS < 2.14 doesn't support 'crush' hash type, and cannot handle
* unknown hash if client doesn't set a valid one. switch to fnv_1a_64.
*/
- if (!(exp_connect_flags2(sbi->ll_md_exp) & OBD_CONNECT2_CRUSH)) {
+ if (CFS_FAIL_CHECK(OBD_FAIL_LMV_UNKNOWN_STRIPE)) {
+ lump->lum_hash_type = cfs_fail_val;
+ } else if (!(exp_connect_flags2(sbi->ll_md_exp) & OBD_CONNECT2_CRUSH)) {
enum lmv_hash_type type = lump->lum_hash_type &
LMV_HASH_TYPE_MASK;
- if (type == LMV_HASH_TYPE_CRUSH ||
+ if (type >= LMV_HASH_TYPE_CRUSH ||
type == LMV_HASH_TYPE_UNKNOWN)
lump->lum_hash_type = (lump->lum_hash_type ^ type) |
LMV_HASH_TYPE_FNV_1A_64;
}
+ hash_flags = lump->lum_hash_type & ~LMV_HASH_TYPE_MASK;
+ if (hash_flags & ~LMV_HASH_FLAG_KNOWN)
+ RETURN(-EINVAL);
+
if (unlikely(!lmv_user_magic_supported(cpu_to_le32(lump->lum_magic))))
lustre_swab_lmv_user_md(lump);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
+ op_data->op_dir_depth = ll_i2info(parent)->lli_dir_depth;
+
if (ll_sbi_has_encrypt(sbi) &&
(IS_ENCRYPTED(parent) ||
- unlikely(llcrypt_dummy_context_enabled(parent)))) {
+ unlikely(ll_sb_has_test_dummy_encryption(parent->i_sb)))) {
err = llcrypt_get_encryption_info(parent);
if (err)
GOTO(out_op_data, err);
encrypt = true;
}
- if (sbi->ll_flags & LL_SBI_FILE_SECCTX) {
+ if (test_bit(LL_SBI_FILE_SECCTX, sbi->ll_flags)) {
/* selinux_dentry_init_security() uses dentry->d_parent and name
* to determine the security context for the file. So our fake
* dentry should be real enough for this purpose. */
err = md_create(sbi->ll_md_exp, op_data, lump, len, mode,
from_kuid(&init_user_ns, current_fsuid()),
from_kgid(&init_user_ns, current_fsgid()),
- cfs_curproc_cap_pack(), 0, &request);
+ current_cap(), 0, &request);
if (err)
GOTO(out_request, err);
dentry.d_inode = inode;
- if (sbi->ll_flags & LL_SBI_FILE_SECCTX) {
+ if (test_bit(LL_SBI_FILE_SECCTX, sbi->ll_flags)) {
/* no need to protect selinux_inode_setsecurity() by
* inode_lock. Taking it would lead to a client deadlock
* LU-13617
case LOV_USER_MAGIC_COMP_V1:
lum_size = ((struct lov_comp_md_v1 *)lump)->lcm_size;
break;
- case LMV_USER_MAGIC:
- if (lump->lmm_magic != cpu_to_le32(LMV_USER_MAGIC))
- lustre_swab_lmv_user_md(
- (struct lmv_user_md *)lump);
- lum_size = sizeof(struct lmv_user_md);
+ case LMV_USER_MAGIC: {
+ struct lmv_user_md *lmv = (struct lmv_user_md *)lump;
+
+ /* MDS < 2.14 doesn't support 'crush' hash type, and
+ * cannot handle unknown hash if client doesn't set a
+ * valid one. switch to fnv_1a_64.
+ */
+ if (!(exp_connect_flags2(sbi->ll_md_exp) &
+ OBD_CONNECT2_CRUSH)) {
+ enum lmv_hash_type type = lmv->lum_hash_type &
+ LMV_HASH_TYPE_MASK;
+
+ if (type >= LMV_HASH_TYPE_CRUSH ||
+ type == LMV_HASH_TYPE_UNKNOWN)
+ lmv->lum_hash_type =
+ (lmv->lum_hash_type ^ type) |
+ LMV_HASH_TYPE_FNV_1A_64;
+ }
+ if (lmv->lum_magic != cpu_to_le32(LMV_USER_MAGIC))
+ lustre_swab_lmv_user_md(lmv);
+ lum_size = sizeof(*lmv);
break;
+ }
case LOV_USER_MAGIC_SPECIFIC: {
struct lov_user_md_v3 *v3 =
(struct lov_user_md_v3 *)lump;
RETURN(rc);
}
-static int ll_dir_get_default_layout(struct inode *inode, void **plmm,
- int *plmm_size,
- struct ptlrpc_request **request, u64 valid,
- enum get_default_layout_type type)
+int ll_dir_get_default_layout(struct inode *inode, void **plmm, int *plmm_size,
+ struct ptlrpc_request **request, u64 valid,
+ enum get_default_layout_type type)
{
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct mdt_body *body;
struct lov_mds_md *lmm = NULL;
struct ptlrpc_request *req = NULL;
- int rc, lmm_size;
+ int lmm_size = OBD_MAX_DEFAULT_EA_SIZE;
struct md_op_data *op_data;
struct lu_fid fid;
- ENTRY;
+ int rc;
- rc = ll_get_default_mdsize(sbi, &lmm_size);
- if (rc)
- RETURN(rc);
+ ENTRY;
- op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL,
- 0, lmm_size, LUSTRE_OPC_ANY,
- NULL);
+ op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, lmm_size,
+ LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
rc = ll_dir_get_default_layout(inode, (void **)&lmm, &lmm_size,
&req, valid, 0);
if (rc == -ENODATA && !fid_is_root(ll_inode2fid(inode)) &&
- !(valid & (OBD_MD_MEA|OBD_MD_DEFAULT_MEA)) && root_request != NULL){
+ !(valid & OBD_MD_MEA) && root_request != NULL) {
int rc2 = ll_dir_get_default_layout(inode, (void **)&lmm,
&lmm_size, &root_req, valid,
GET_DEFAULT_LAYOUT_ROOT);
return 0;
}
-int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
+int quotactl_ioctl(struct super_block *sb, struct if_quotactl *qctl)
{
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
int cmd = qctl->qc_cmd;
int type = qctl->qc_type;
int id = qctl->qc_id;
case LUSTRE_Q_SETQUOTAPOOL:
case LUSTRE_Q_SETINFOPOOL:
case LUSTRE_Q_SETDEFAULT_POOL:
+ case LUSTRE_Q_DELETEQID:
if (!capable(CAP_SYS_ADMIN))
RETURN(-EPERM);
+
+ if (sb->s_flags & SB_RDONLY)
+ RETURN(-EROFS);
break;
case Q_GETQUOTA:
case LUSTRE_Q_GETDEFAULT:
else
RETURN(-EINVAL);
- switch (valid) {
- case QC_MDTIDX:
- rc = obd_iocontrol(OBD_IOC_QUOTACTL, sbi->ll_md_exp,
- sizeof(*qctl), qctl, NULL);
- break;
- case QC_OSTIDX:
- rc = obd_iocontrol(OBD_IOC_QUOTACTL, sbi->ll_dt_exp,
- sizeof(*qctl), qctl, NULL);
- break;
- case QC_UUID:
- rc = obd_iocontrol(OBD_IOC_QUOTACTL, sbi->ll_md_exp,
- sizeof(*qctl), qctl, NULL);
- if (rc == -EAGAIN)
- rc = obd_iocontrol(OBD_IOC_QUOTACTL,
- sbi->ll_dt_exp,
- sizeof(*qctl), qctl, NULL);
- break;
- default:
- rc = -EINVAL;
- break;
- }
-
- if (rc)
- RETURN(rc);
+ switch (valid) {
+ case QC_MDTIDX:
+ rc = obd_iocontrol(OBD_IOC_QUOTACTL, sbi->ll_md_exp,
+ sizeof(*qctl), qctl, NULL);
+ break;
+ case QC_OSTIDX:
+ rc = obd_iocontrol(OBD_IOC_QUOTACTL, sbi->ll_dt_exp,
+ sizeof(*qctl), qctl, NULL);
+ break;
+ case QC_UUID:
+ rc = obd_iocontrol(OBD_IOC_QUOTACTL, sbi->ll_md_exp,
+ sizeof(*qctl), qctl, NULL);
+ if (rc == -EAGAIN)
+ rc = obd_iocontrol(OBD_IOC_QUOTACTL,
+ sbi->ll_dt_exp,
+ sizeof(*qctl), qctl, NULL);
+ break;
+ default:
+ rc = -EINVAL;
+ break;
+ }
- qctl->qc_cmd = cmd;
- } else {
- struct obd_quotactl *oqctl;
+ qctl->qc_cmd = cmd;
+ if (rc)
+ RETURN(rc);
+ } else {
+ struct obd_quotactl *oqctl;
int oqctl_len = sizeof(*oqctl);
if (LUSTRE_Q_CMD_IS_POOL(cmd))
int ll_rmfid(struct file *file, void __user *arg)
{
const struct fid_array __user *ufa = arg;
+ struct inode *inode = file_inode(file);
struct fid_array *lfa = NULL;
size_t size;
unsigned nr;
ENTRY;
if (!capable(CAP_DAC_READ_SEARCH) &&
- !(ll_i2sbi(file_inode(file))->ll_flags & LL_SBI_USER_FID2PATH))
+ !test_bit(LL_SBI_USER_FID2PATH, ll_i2sbi(inode)->ll_flags))
RETURN(-EPERM);
/* Only need to get the buflen */
if (get_user(nr, &ufa->fa_nr))
if (lmmsize > sizeof(*ulmv))
GOTO(finish_req, rc = -EINVAL);
+ if (root_request != NULL) {
+ struct lmv_user_md *lum;
+ struct ll_inode_info *lli;
+
+ lum = (struct lmv_user_md *)lmm;
+ lli = ll_i2info(inode);
+ if (lum->lum_max_inherit !=
+ LMV_INHERIT_UNLIMITED) {
+ if (lum->lum_max_inherit ==
+ LMV_INHERIT_NONE ||
+ lum->lum_max_inherit <
+ LMV_INHERIT_END ||
+ lum->lum_max_inherit >
+ LMV_INHERIT_MAX ||
+ lum->lum_max_inherit <
+ lli->lli_dir_depth)
+ GOTO(finish_req, rc = -ENODATA);
+
+ if (lum->lum_max_inherit ==
+ lli->lli_dir_depth) {
+ lum->lum_max_inherit =
+ LMV_INHERIT_NONE;
+ lum->lum_max_inherit_rr =
+ LMV_INHERIT_RR_NONE;
+ goto out_copy;
+ }
+
+ lum->lum_max_inherit -=
+ lli->lli_dir_depth;
+ }
+
+ if (lum->lum_max_inherit_rr !=
+ LMV_INHERIT_RR_UNLIMITED) {
+ if (lum->lum_max_inherit_rr ==
+ LMV_INHERIT_NONE ||
+ lum->lum_max_inherit_rr <
+ LMV_INHERIT_RR_END ||
+ lum->lum_max_inherit_rr >
+ LMV_INHERIT_RR_MAX ||
+ lum->lum_max_inherit_rr <=
+ lli->lli_dir_depth) {
+ lum->lum_max_inherit_rr =
+ LMV_INHERIT_RR_NONE;
+ goto out_copy;
+ }
+
+ if (lum->lum_max_inherit_rr >
+ lli->lli_dir_depth)
+ lum->lum_max_inherit_rr -=
+ lli->lli_dir_depth;
+ }
+ }
+out_copy:
if (copy_to_user(ulmv, lmm, lmmsize))
GOTO(finish_req, rc = -EFAULT);
__u32 __user *lmmsizep = NULL;
struct lu_fid __user *fidp = NULL;
int lmmsize;
+ bool api32;
if (cmd == IOC_MDC_GETFILEINFO_V1 ||
cmd == IOC_MDC_GETFILEINFO_V2 ||
GOTO(out_req, rc = -EFAULT);
rc = -EOVERFLOW;
}
+ api32 = test_bit(LL_SBI_32BIT_API, sbi->ll_flags);
if (cmd == IOC_MDC_GETFILEINFO_V1 ||
cmd == LL_IOC_MDC_GETINFO_V1) {
st.st_uid = body->mbo_uid;
st.st_gid = body->mbo_gid;
st.st_rdev = body->mbo_rdev;
- st.st_size = body->mbo_size;
+ if (llcrypt_require_key(inode) == -ENOKEY)
+ st.st_size = round_up(st.st_size,
+ LUSTRE_ENCRYPTION_UNIT_SIZE);
+ else
+ st.st_size = body->mbo_size;
st.st_blksize = PAGE_SIZE;
st.st_blocks = body->mbo_blocks;
st.st_atime = body->mbo_atime;
st.st_mtime = body->mbo_mtime;
st.st_ctime = body->mbo_ctime;
st.st_ino = cl_fid_build_ino(&body->mbo_fid1,
- sbi->ll_flags &
- LL_SBI_32BIT_API);
+ api32);
if (copy_to_user(statp, &st, sizeof(st)))
GOTO(out_req, rc = -EFAULT);
stx.stx_gid = body->mbo_gid;
stx.stx_mode = body->mbo_mode;
stx.stx_ino = cl_fid_build_ino(&body->mbo_fid1,
- sbi->ll_flags &
- LL_SBI_32BIT_API);
- stx.stx_size = body->mbo_size;
+ api32);
+ if (llcrypt_require_key(inode) == -ENOKEY)
+ stx.stx_size = round_up(stx.stx_size,
+ LUSTRE_ENCRYPTION_UNIT_SIZE);
+ else
+ stx.stx_size = body->mbo_size;
stx.stx_blocks = body->mbo_blocks;
stx.stx_atime.tv_sec = body->mbo_atime;
stx.stx_ctime.tv_sec = body->mbo_ctime;
GOTO(out_quotactl, rc = -EFAULT);
}
- rc = quotactl_ioctl(sbi, qctl);
- if (rc == 0 &&
+ rc = quotactl_ioctl(inode->i_sb, qctl);
+ if ((rc == 0 || rc == -ENODATA) &&
copy_to_user((void __user *)arg, qctl, sizeof(*qctl)))
rc = -EFAULT;
RETURN(rc);
}
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_FLUSHCTX:
int len;
char *filename;
int namelen = 0;
+ __u32 flags;
int rc;
rc = obd_ioctl_getdata(&data, &len, (void __user *)arg);
filename = data->ioc_inlbuf1;
namelen = data->ioc_inllen1;
+ flags = data->ioc_type;
if (namelen < 1 || namelen != strlen(filename) + 1) {
CDEBUG(D_INFO, "IOC_MDC_LOOKUP missing filename\n");
GOTO(migrate_free, rc);
}
- rc = ll_migrate(inode, file, lum, filename);
+ rc = ll_migrate(inode, file, lum, filename, flags);
migrate_free:
OBD_FREE_LARGE(data, len);
RETURN(ll_ioctl_fsgetxattr(inode, cmd, arg));
case FS_IOC_FSSETXATTR:
RETURN(ll_ioctl_fssetxattr(inode, cmd, arg));
+ case LL_IOC_PROJECT:
+ RETURN(ll_ioctl_project(file, cmd, arg));
case LL_IOC_PCC_DETACH_BY_FID: {
struct lu_pcc_detach_fid *detach;
struct lu_fid *fid;
if (!S_ISREG(inode2->i_mode))
GOTO(out_iput, rc = -EINVAL);
- if (!inode_owner_or_capable(inode2))
+ if (!inode_owner_or_capable(&init_user_ns, inode2))
GOTO(out_iput, rc = -EPERM);
rc = pcc_ioctl_detach(inode2, detach->pccd_opt);
((api32 && offset <= LL_DIR_END_OFF_32BIT) ||
(!api32 && offset <= LL_DIR_END_OFF))) {
if (offset != file->f_pos) {
+ bool hash64;
+
+ hash64 = test_bit(LL_SBI_64BIT_HASH, sbi->ll_flags);
if ((api32 && offset == LL_DIR_END_OFF_32BIT) ||
(!api32 && offset == LL_DIR_END_OFF))
fd->lfd_pos = MDS_DIR_END_OFF;
- else if (api32 && sbi->ll_flags & LL_SBI_64BIT_HASH)
+ else if (api32 && hash64)
fd->lfd_pos = offset << 32;
else
fd->lfd_pos = offset;
RETURN(ll_file_release(inode, file));
}
+/* notify error if partially read striped directory */
+static int ll_dir_flush(struct file *file, fl_owner_t id)
+{
+ struct ll_file_data *lfd = file->private_data;
+ int rc = lfd->fd_partial_readdir_rc;
+
+ lfd->fd_partial_readdir_rc = 0;
+
+ return rc;
+}
+
const struct file_operations ll_dir_operations = {
.llseek = ll_dir_seek,
.open = ll_dir_open,
#endif
.unlocked_ioctl = ll_dir_ioctl,
.fsync = ll_fsync,
+ .flush = ll_dir_flush,
};