From patchwork Wed Jun 29 01:32:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 9204199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D57F560752 for ; Wed, 29 Jun 2016 01:33:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C726028623 for ; Wed, 29 Jun 2016 01:33:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9C2528630; Wed, 29 Jun 2016 01:33:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 241EA28623 for ; Wed, 29 Jun 2016 01:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752489AbcF2BdD (ORCPT ); Tue, 28 Jun 2016 21:33:03 -0400 Received: from imap.thunk.org ([74.207.234.97]:56242 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbcF2BdC (ORCPT ); Tue, 28 Jun 2016 21:33:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=Message-Id:Date:Subject:Cc:To:From; bh=eXp8+lOfaxKJoahQ9xM3Lc32zIbznp0egKja//6Y18g=; b=cYrrVLuNDOqQfbdjhD3pfUoqU8zXIh7TkjYlRKLwBRVPRiEoy3UKp+3qLEJFi0iu+awoYwfAjUuHyrM2RJ3YM+K8tfrl/s3nVztoNba4DYve6diT4xlgQt7yYuTAw3gallhaC8qpALNatFjV5bqovuykCApk6/t7F3Y0Y6ncBVs=; Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.84_2) (envelope-from ) id 1bI4N9-0001fz-EM; Wed, 29 Jun 2016 01:32:59 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id 9A621820425; Tue, 28 Jun 2016 21:32:58 -0400 (EDT) From: Theodore Ts'o To: fstests@vger.kernel.org Cc: Theodore Ts'o Subject: [PATCH] common: ext4 doesn't support O_DIRECT with encryption Date: Tue, 28 Jun 2016 21:32:55 -0400 Message-Id: <1467163975-11183-1-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 2.5.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Teach _require_odirect to skip the O_DIRECT tests if the ext4 mount option "test_dummy_encryption" is enabled, since O_DIRECT doesen't make sense when file system level encryption is enabled, and several tests which use O_DIRECT --- ext4/301, ext4/304, generic/250 and generic/252 --- fail when encryption is enabled. Signed-off-by: Theodore Ts'o Reviewed-by: Eryu Guan --- common/rc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/common/rc b/common/rc index adda940..003400d 100644 --- a/common/rc +++ b/common/rc @@ -1933,12 +1933,18 @@ _require_xfs_db_command() # check that kernel and filesystem support direct I/O _require_odirect() { - testfile=$TEST_DIR/$$.direct - $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile > /dev/null 2>&1 - if [ $? -ne 0 ]; then - _notrun "O_DIRECT is not supported" - fi - rm -f $testfile 2>&1 > /dev/null + if [ $FSTYP = "ext4" ] ; then + if echo "$MOUNT_OPTIONS" | grep -q "test_dummy_encryption" + then + _notrun "ext4 encryption doesn't support O_DIRECT" + fi + fi + testfile=$TEST_DIR/$$.direct + $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile > /dev/null 2>&1 + if [ $? -ne 0 ]; then + _notrun "O_DIRECT is not supported" + fi + rm -f $testfile 2>&1 > /dev/null } # Check that a fs has enough free space (in 1024b blocks)