Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp473149pxx; Wed, 28 Oct 2020 09:07:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJWLjW/oK+9CbuUkyc/IEKtm9To9eQElA/2fADpGWhOc7nJFu+G7AJaFqgJiPymKQR+j7A X-Received: by 2002:a17:906:3997:: with SMTP id h23mr8006480eje.191.1603901252038; Wed, 28 Oct 2020 09:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603901252; cv=none; d=google.com; s=arc-20160816; b=axX7tFkaPamu8qsPgV972CGEvcnEkyjyH5G1SsT6p42t8ucFY6BgWjzCHFzcy9t7B0 9JhJ7+y4DNl55uVtFdKYxlY8yrIjrEmj961f+Svejlcrj8KehUg3Exg0GbTgBX9MOKko HvYuz13K2ghEy4n/5m+ojCScEtCoF4s3Vx5e6EiZQxfFZoHoLxVbeCMTm7jfEgp1DX27 n5O5kfjmKmm6mlJpWFo73dg5LuZkWF4AMx03tlrAa5ThTKdoTWsvB2Kfgk4G0baDtRqE tovMHj7yS5A/rkPP9N8LwktAukrm3aZFxioz+/j873tidvEvFhzIIM1PAsSkeqV7Ot77 p2SA== 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=MVdUfv69W4wEnUbU98bbxCyrWgdOXUfl9U+DKOkE+Wo=; b=PTRwF1FCaMlW5RgTOylxnIPUZA5JMZH6NzI6HR30MEGtFhFf/WtaVLzLreZ4s7PDia g1nWLbpeptZGLHeHtqL7DLyeWNqTm9Mld6Om7IUOJJsg/DMIL5r4YSdwTlQvGw8spL0v fLkC2/YsftVX/dQMezgP2EcBBSYYAtOOVNIEL3GDT2SSDAcpt2J5PVzu4jHd9O0dfH6m jGCcPhjByYy2nFe+5GMo4jOfFeKwD0ste7Ec/O+g34BAjhGRYnnV9glwFYy7YO2a4Ozc JJxHXp6ZZm1Y/9hiuqQO/Lv+mihgkdo19nu/1z4aehAUoiUxmGMxQx/xtV7Mn1jMp/Ks 3kYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TEiKXjsD; 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=fail (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 gf17si2900638ejb.226.2020.10.28.09.07.09; Wed, 28 Oct 2020 09:07:32 -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=@kernel.org header.s=default header.b=TEiKXjsD; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1814859AbgJ0RAG (ORCPT + 99 others); Tue, 27 Oct 2020 13:00:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:44400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1793902AbgJ0PJA (ORCPT ); Tue, 27 Oct 2020 11:09:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E2E5D2072E; Tue, 27 Oct 2020 15:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811339; bh=rk7L/zr8SJJ4sd5md9ctIa/I+Q+AaUi+cpngVfaac7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TEiKXjsDaoSQXEjPAOh/7F539VAdZlD0jB6IBwJ+i8Z8saGI8f8LSfcLbaRjlyzCD GsWrC1ZWjvUBBiUxlKLdOg1QBwktSbpTqetReFs6OrL0veyzoQLZsUuywd4CgVjIez Gvc+wd150DQlOqLuDSAJOKDv17gJst28lYC8kdVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Yang , Jan Kara , Ira Weiny , Andreas Dilger , Theodore Tso , Sasha Levin Subject: [PATCH 5.8 459/633] ext4: disallow modifying DAX inode flag if inline_data has been set Date: Tue, 27 Oct 2020 14:53:22 +0100 Message-Id: <20201027135544.253186332@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Xiao Yang [ Upstream commit aa2f77920b743c44e02e2dc8474bbf8bd30007a2 ] inline_data is mutually exclusive to DAX so enabling both of them triggers the following issue: ------------------------------------------ # mkfs.ext4 -F -O inline_data /dev/pmem1 ... # mount /dev/pmem1 /mnt # echo 'test' >/mnt/file # lsattr -l /mnt/file /mnt/file Inline_Data # xfs_io -c "chattr +x" /mnt/file # xfs_io -c "lsattr -v" /mnt/file [dax] /mnt/file # umount /mnt # mount /dev/pmem1 /mnt # cat /mnt/file cat: /mnt/file: Numerical result out of range ------------------------------------------ Fixes: b383a73f2b83 ("fs/ext4: Introduce DAX inode flag") Signed-off-by: Xiao Yang Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20200828084330.15776-1-yangx.jy@cn.fujitsu.com Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/ext4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index ff46defc65683..dc943e714d142 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -466,7 +466,7 @@ struct flex_groups { /* Flags which are mutually exclusive to DAX */ #define EXT4_DAX_MUT_EXCL (EXT4_VERITY_FL | EXT4_ENCRYPT_FL |\ - EXT4_JOURNAL_DATA_FL) + EXT4_JOURNAL_DATA_FL | EXT4_INLINE_DATA_FL) /* Mask out flags that are inappropriate for the given type of inode. */ static inline __u32 ext4_mask_flags(umode_t mode, __u32 flags) -- 2.25.1