void ccc_io_update_iov(const struct lu_env *env, struct ccc_io *cio,
struct cl_io *io);
int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
- struct cl_io *io, loff_t start, size_t count, int vfslock,
- int *exceed);
+ struct cl_io *io, loff_t start, size_t count, int *exceed);
void ccc_req_completion(const struct lu_env *env,
const struct cl_req_slice *slice, int ioret);
void ccc_req_attr_set(const struct lu_env *env,const struct cl_req_slice *slice,
}
}
-static void ccc_object_size_lock(struct cl_object *obj, int vfslock)
+static void ccc_object_size_lock(struct cl_object *obj)
{
struct inode *inode = ccc_object_inode(obj);
- if (vfslock)
- cl_isize_lock(inode, 0);
+ cl_isize_lock(inode, 0);
cl_object_attr_lock(obj);
}
-static void ccc_object_size_unlock(struct cl_object *obj, int vfslock)
+static void ccc_object_size_unlock(struct cl_object *obj)
{
struct inode *inode = ccc_object_inode(obj);
cl_object_attr_unlock(obj);
- if (vfslock)
- cl_isize_unlock(inode, 0);
+ cl_isize_unlock(inode, 0);
}
/**
* protect consistency between inode size and cl_object
* attributes. cl_object_size_lock() protects consistency between cl_attr's of
* top-object and sub-objects.
- *
- * In page fault path cl_isize_lock cannot be taken, client has to live with
- * the resulting races.
*/
int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
- struct cl_io *io, loff_t start, size_t count, int vfslock,
- int *exceed)
+ struct cl_io *io, loff_t start, size_t count, int *exceed)
{
struct cl_attr *attr = ccc_env_thread_attr(env);
struct inode *inode = ccc_object_inode(obj);
* ll_inode_size_lock(). This guarantees that short reads are handled
* correctly in the face of concurrent writes and truncates.
*/
- ccc_object_size_lock(obj, vfslock);
+ ccc_object_size_lock(obj);
result = cl_object_attr_get(env, obj, attr);
if (result == 0) {
kms = attr->cat_kms;
* return a short read (B) or some zeroes at the end
* of the buffer (C)
*/
- ccc_object_size_unlock(obj, vfslock);
+ ccc_object_size_unlock(obj);
result = cl_glimpse_lock(env, io, inode, obj);
if (result == 0 && exceed != NULL) {
/* If objective page index exceed end-of-file
* which will always be >= the kms value here.
* b=11081
*/
- /*
- * XXX in a page fault path, change inode size without
- * ll_inode_size_lock() held! there is a race
- * condition with truncate path. (see ll_extent_lock)
- */
- /*
- * XXX i_size_write() is not used because it is not
- * safe to take the ll_inode_size_lock() due to a
- * potential lock inversion (bug 6077). And since
- * it's not safe to use i_size_write() without a
- * covering mutex we do the assignment directly. It
- * is not critical that the size be correct.
- */
if (cl_isize_read(inode) < kms) {
- if (vfslock)
- cl_isize_write_nolock(inode, kms);
- else
- cl_isize_write(inode, kms);
+ cl_isize_write_nolock(inode, kms);
CDEBUG(D_VFSTRACE,
DFID" updating i_size "LPU64"\n",
PFID(lu_object_fid(&obj->co_lu)),
}
}
}
- ccc_object_size_unlock(obj, vfslock);
+ ccc_object_size_unlock(obj);
return result;
}
if (IS_ERR(iogroup))
RETURN(PTR_ERR(iogroup));
- err = ccc_prep_size(env, obj, io, pos, cnt, 0, &exceed);
+ err = ccc_prep_size(env, obj, io, pos, cnt, &exceed);
if (err != 0 || (write == 0 && exceed != 0))
GOTO(out, err);
* must be called under ->lli_size_sem */
void ll_truncate(struct inode *inode)
{
- struct ll_inode_info *lli = ll_i2info(inode);
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) to %llu\n", inode->i_ino,
inode->i_generation, inode, i_size_read(inode));
ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_TRUNC, 1);
- if (lli->lli_size_sem_owner == cfs_current()) {
- LASSERT_SEM_LOCKED(&lli->lli_size_sem);
- ll_inode_size_unlock(inode, 0);
- }
EXIT;
return;
int result;
/*
* Only ll_inode_size_lock is taken at this level. lov_stripe_lock()
- * is grabbed by ll_truncate() only over call to obd_adjust_kms(). If
- * vmtruncate returns 0, then ll_truncate dropped ll_inode_size_lock()
+ * is grabbed by ll_truncate() only over call to obd_adjust_kms().
*/
ll_inode_size_lock(inode, 0);
result = vmtruncate(inode, size);
- if (result != 0)
- ll_inode_size_unlock(inode, 0);
+ ll_inode_size_unlock(inode, 0);
return result;
}
CDEBUG(D_VFSTRACE, "read: -> [%lli, %lli)\n", pos, pos + cnt);
- result = ccc_prep_size(env, obj, io, pos, tot, 1, &exceed);
+ result = ccc_prep_size(env, obj, io, pos, tot, &exceed);
if (result != 0)
return result;
else if (exceed != 0)
/* offset of the last byte on the page */
offset = cl_offset(obj, fio->ft_index + 1) - 1;
LASSERT(cl_index(obj, offset) == fio->ft_index);
- result = ccc_prep_size(env, obj, io, 0, offset + 1, 0, NULL);
+ result = ccc_prep_size(env, obj, io, 0, offset + 1, NULL);
if (result != 0)
return result;
nobase_noinst_SCRIPTS += test-groups/regression test-groups/regression-mpi
nobase_noinst_SCRIPTS += acl/make-tree acl/run cfg/ncli.sh
nobase_noinst_SCRIPTS += racer/dir_create.sh racer/file_create.sh racer/file_list.sh
-nobase_noinst_SCRIPTS += racer/file_rm.sh racer/racer.sh racer/file_concat.sh
+nobase_noinst_SCRIPTS += racer/file_rm.sh racer/racer.sh racer/file_concat.sh racer/file_exec.sh
nobase_noinst_SCRIPTS += racer/file_link.sh racer/file_rename.sh racer/file_symlink.sh
nobase_noinst_SCRIPTS += rmtacl/make-tree rmtacl/run
nobase_noinst_DATA = acl/cp.test acl/getfacl-noacl.test acl/inheritance.test
racer=$LUSTRE/tests/racer/racer.sh
echo racer: $racer
+DURATION=${DURATION:-900}
+[ "$SLOW" = "no" ] && DURATION=300
+MOUNT_2=${MOUNT_2:-"yes"}
+
+build_test_filter
+check_and_setup_lustre
+
CLIENTS=${CLIENTS:-$HOSTNAME}
-RACERDIRS=${RACERDIRS:-$DIR}
+RACERDIRS=${RACERDIRS:-"$DIR $DIR2"}
echo RACERDIRS=$RACERDIRS
for d in ${RACERDIRS}; do
+ is_mounted $d || continue
+
RDIRS="$RDIRS $d/racer"
mkdir -p $d/racer
# lfs setstripe $d/racer -c -1
done
-DURATION=${DURATION:-900}
-[ "$SLOW" = "no" ] && DURATION=300
-
-build_test_filter
-check_and_setup_lustre
-
# run racer
test_1() {
local rrc=0
--- /dev/null
+#!/bin/bash
+
+DIR=$1
+MAX=$2
+PROG=/bin/sleep
+
+while /bin/true ; do
+ file=$((RANDOM % MAX))
+ cp $PROG $DIR/$file > /dev/null 2>&1
+ $DIR/$file 0.$((RANDOM % 5 + 1)) 2> /dev/null
+ sleep $((RANDOM % 3))
+done
+
mkdir -p $DIR
RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \
-file_list file_concat"
+file_list file_concat file_exec"
racer_cleanup()
{