Whamcloud - gitweb
LU-8656 vvp: Add S_NOSEC support
[fs/lustre-release.git] / lustre / llite / vvp_io.c
index 35a5c3d..a6c355a 100644 (file)
@@ -1056,6 +1056,13 @@ static int vvp_io_write_start(const struct lu_env *env,
                RETURN(-EFBIG);
        }
 
+       /* Tests to verify we take the i_mutex correctly */
+       if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_SEC) && !lock_inode)
+               RETURN(-EINVAL);
+
+       if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_NOSEC) && lock_inode)
+               RETURN(-EINVAL);
+
        /*
         * When using the locked AIO function (generic_file_aio_write())
         * testing has shown the inode mutex to be a limiting factor