Processes can wait forever in osc_extent_wait() for the extent state
to change because the extent write is not started before the wait
begins. A 4.7 kernel change to generic_write_sync() modified it to
check IOCB_DSYNC instead of O_SYNC. Thus an active extent is not
released (written) in osc_io_commit_async() in the synchronous case.
Linux commit:
dde0c2e79848298cc25621ad080d47f94dbd7cce
Cray-bug-id: LUS-7435
Signed-off-by: Ann Koehler <amk@cray.com>
Change-Id: I03fd3f17c0c21bcb176730a0edf449d2e5e0c108
Reviewed-on: https://review.whamcloud.com/35472
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#
# LC_GENERIC_WRITE_SYNC_2ARGS
#
#
# LC_GENERIC_WRITE_SYNC_2ARGS
#
-# Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
-# direct-io: eliminate the offset argument to ->direct_IO
+# Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
+# fs: add IOCB_SYNC and IOCB_DSYNC
#
AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
#
AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
-void ll_io_init(struct cl_io *io, struct file *file, enum cl_io_type iot)
+void ll_io_init(struct cl_io *io, struct file *file, enum cl_io_type iot,
+ struct vvp_io_args *args)
{
struct inode *inode = file_inode(file);
struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
{
struct inode *inode = file_inode(file);
struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
io->u.ci_wr.wr_sync = !!(file->f_flags & O_SYNC ||
file->f_flags & O_DIRECT ||
IS_SYNC(inode));
io->u.ci_wr.wr_sync = !!(file->f_flags & O_SYNC ||
file->f_flags & O_DIRECT ||
IS_SYNC(inode));
+#ifdef HAVE_GENERIC_WRITE_SYNC_2ARGS
+ io->u.ci_wr.wr_sync |= !!(args &&
+ args->via_io_subtype == IO_NORMAL &&
+ args->u.normal.via_iocb->ki_flags & IOCB_DSYNC);
+#endif
io->ci_obj = ll_i2info(inode)->lli_clob;
io->ci_lockreq = CILR_MAYBE;
if (ll_file_nolock(file)) {
io->ci_obj = ll_i2info(inode)->lli_clob;
io->ci_lockreq = CILR_MAYBE;
if (ll_file_nolock(file)) {
restart:
io = vvp_env_thread_io(env);
restart:
io = vvp_env_thread_io(env);
- ll_io_init(io, file, iot);
+ ll_io_init(io, file, iot, args);
io->ci_ndelay_tried = retried;
if (cl_io_rw_init(env, io, iot, *ppos, count) == 0) {
io->ci_ndelay_tried = retried;
if (cl_io_rw_init(env, io, iot, *ppos, count) == 0) {
extern void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
struct ll_file_data *file, loff_t pos,
size_t count, int rw);
extern void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
struct ll_file_data *file, loff_t pos,
size_t count, int rw);
-void ll_io_init(struct cl_io *io, struct file *file, enum cl_io_type iot);
#ifdef HAVE_INODEOPS_ENHANCED_GETATTR
int ll_getattr(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int flags);
#ifdef HAVE_INODEOPS_ENHANCED_GETATTR
int ll_getattr(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int flags);
+void ll_io_init(struct cl_io *io, struct file *file, enum cl_io_type iot,
+ struct vvp_io_args *args);
+
/* llite/llite_mmap.c */
int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last);
/* llite/llite_mmap.c */
int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last);
GOTO(out_free_work, rc = PTR_ERR(env));
io = vvp_env_thread_io(env);
GOTO(out_free_work, rc = PTR_ERR(env));
io = vvp_env_thread_io(env);
- ll_io_init(io, file, CIT_READ);
+ ll_io_init(io, file, CIT_READ, NULL);
rc = ll_readahead_file_kms(env, io, &kms);
if (rc != 0)
rc = ll_readahead_file_kms(env, io, &kms);
if (rc != 0)