Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2507656pxj; Mon, 10 May 2021 04:48:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxukQe3e/GX1GkfbUYLqsjoZM86AC/qCgy+d66/vzC84YOD6CUNGS7WBdPGm3VBlYtbVOiO X-Received: by 2002:a17:907:766d:: with SMTP id kk13mr25437422ejc.417.1620647311652; Mon, 10 May 2021 04:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620647311; cv=none; d=google.com; s=arc-20160816; b=0tlnqqj3rMbdigx+Cl5cFYvlryDihtw0eMMlT4jDwgzK6LhPbW9Hi6CKXohsAFrsx4 pVw0E3OleE3KGEAhmzOqnFJbmFk3m7Z3xNIFSG0nUG4qsT6h/gfLtrcKpw79aJMEOUg4 uccFVJsgr9CVf3uF104olTbq0cQowT8RSwQJs05x8LuEDZdiAL08PrY0F8zNwoKsio6h xuMwMlm2cFQN/olqt5COfnvluMOMMoAkeR0V7rw/yx8MvLAkBKX0yO4FeE+64q2Avfq/ XDRQDMrJruR94RW2FXkuj6660QRYiUYMWfHdp58gzfjQZPkpqZO+v6CKR/lthysgBYcg A/VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WYZ9EOLY25/IY0oyQWBQmF2NnkJM4GCpuSkNUiobKmo=; b=MhCSMcRz8ovaX5SJgRgitz3N1H1Vgn9frXcCtyBBZOYUoaqvTQTGwxdczSNzi5/ms1 o4c9gXD1bPD7UmpI1XxPZbodEp+GtgWVWFrBQ62vHFnoG4d2kI0iRg2sk9Hwb/SLdBQj 70s8QyjUTiI90X7FdodbEj8jT2/4BNP8Iyst5eyzPfJaPXb2sDIOEy6fuWD3PNUhMtMX LmoOVJ79LYm3eCxVaItHaNl7emwUzLjPWm8mJvgifxuRUjDSexUi1jUyh59JdzqdMJ7o 2BIO/O2vq2REDTgqGPcfLfpe0RfXCY+c+IjuZmbp8xx3r0Jcb+bo6KC4T0Ec5LM5HeQp GzJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uJa4RpqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si13838136eds.79.2021.05.10.04.48.08; Mon, 10 May 2021 04:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uJa4RpqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241121AbhEJLhf (ORCPT + 99 others); Mon, 10 May 2021 07:37:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:52164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbhEJKzL (ORCPT ); Mon, 10 May 2021 06:55:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D8B861976; Mon, 10 May 2021 10:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643347; bh=Et9ybeFG/T13ZeHpjvXLj3rtpFizC+VnvgdSddpH7b0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJa4RpqNEORhnwEGBRLDlJLA5xFI6hn9nPi+jJAQlHHwveFO/Ct8l01/8uu3S82Db QO9JmQX0T/TAWVjiz0O6vr//WhJs62xODyzSB2YvnwEQxJIEql3VQX12yiHMJe9xwe rCOi0qRM4Bu9AEjBvVwMCPgQIJoHnM/nMOpQ57/8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Theodore Tso Subject: [PATCH 5.10 271/299] ext4: allow the dax flag to be set and cleared on inline directories Date: Mon, 10 May 2021 12:21:08 +0200 Message-Id: <20210510102013.887101065@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Theodore Ts'o commit 4811d9929cdae4238baf5b2522247bd2f9fa7b50 upstream. This is needed to allow generic/607 to pass for file systems with the inline data_feature enabled, and it allows the use of file systems where the directories use inline_data, while the files are accessed via DAX. Cc: stable@kernel.org Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/ialloc.c | 3 ++- fs/ext4/ioctl.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -1291,7 +1291,8 @@ got: ei->i_extra_isize = sbi->s_want_extra_isize; ei->i_inline_off = 0; - if (ext4_has_feature_inline_data(sb)) + if (ext4_has_feature_inline_data(sb) && + (!(ei->i_flags & EXT4_DAX_FL) || S_ISDIR(mode))) ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); ret = inode; err = dquot_alloc_inode(inode); --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -312,6 +312,12 @@ static void ext4_dax_dontcache(struct in static bool dax_compatible(struct inode *inode, unsigned int oldflags, unsigned int flags) { + /* Allow the DAX flag to be changed on inline directories */ + if (S_ISDIR(inode->i_mode)) { + flags &= ~EXT4_INLINE_DATA_FL; + oldflags &= ~EXT4_INLINE_DATA_FL; + } + if (flags & EXT4_DAX_FL) { if ((oldflags & EXT4_DAX_MUT_EXCL) || ext4_test_inode_state(inode,