From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73E35C5B577 for ; Sat, 29 Jun 2019 20:09:15 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4001F215EA; Sat, 29 Jun 2019 20:09:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="CmH+SXT+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="JAZ7c3Ed" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4001F215EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hhJeq-0006kJ-HA; Sat, 29 Jun 2019 20:09:12 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hhJeo-0006jv-VM; Sat, 29 Jun 2019 20:09:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=q6LJh+RWUyrFUkX7o1RvpdTLDpjFd/+CXTUvcV17XYk=; b=CmH+SXT+b5Fh629vMbN8rkZOYG enyAgPCZzlnhLiF/rlqQQKwVc10CoPfzg3AcQqdk7YluKMwRfCV75wsApdtbB+GeYMftcfLdEaa46 WnWvfJ6kKodKISDfGf/Mrx6Ec7Nkkza+HRk2Yn5hvxKSJseGDaS13THGv/sQZEq8/G20=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=q6LJh+RWUyrFUkX7o1RvpdTLDpjFd/+CXTUvcV17XYk=; b=JAZ7c3Ed61g8gn5du35F2JUyyr ORsXU5YtVx+63NYzsYRoNyHrYu8AhoPp+A1GF9z57UpK9qyYTiPZcnlbCK61fADSDQF5IKKdy1gCY M2m1505dLra8Hlr4DK5SPO3aiLvCnBFhjjzT0snBHBCdwFC85ug9nhZWoc9G68j+8rcQ=; Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1hhJep-001Z64-CG; Sat, 29 Jun 2019 20:09:12 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 20195AD70; Sat, 29 Jun 2019 20:09:03 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id AA7D51E3F56; Sat, 29 Jun 2019 22:09:01 +0200 (CEST) Date: Sat, 29 Jun 2019 22:09:01 +0200 From: Jan Kara To: " Darrick J. Wong " Message-ID: <20190629200901.GA18642@quack2.suse.cz> References: <156174682897.1557318.14418894077683701275.stgit@magnolia> <156174687185.1557318.13703922197244050336.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <156174687185.1557318.13703922197244050336.stgit@magnolia> User-Agent: Mutt/1.10.1 (2018-07-13) X-Headers-End: 1hhJep-001Z64-CG Subject: Re: [f2fs-dev] [PATCH 5/5] vfs: only allow FSSETXATTR to set DAX flag on files and dirs X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shaggy@kernel.org, jfs-discussion@lists.sourceforge.net, linux-efi@vger.kernel.org, clm@fb.com, adilger.kernel@dilger.ca, ocfs2-devel@oss.oracle.com, hch@infradead.org, linux-nilfs@vger.kernel.org, cluster-devel@redhat.com, linux-ext4@vger.kernel.org, matthew.garrett@nebula.com, josef@toxicpanda.com, reiserfs-devel@vger.kernel.org, viro@zeniv.linux.org.uk, David Sterba , jaegeuk@kernel.org, tytso@mit.edu, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, jk@ozlabs.org, Jan Kara , linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Fri 28-06-19 11:34:31, Darrick J. Wong wrote: > From: Darrick J. Wong > > The DAX flag only applies to files and directories, so don't let it get > set for other types of files. > > Signed-off-by: Darrick J. Wong Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/inode.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > > diff --git a/fs/inode.c b/fs/inode.c > index 670d5408d022..f08711b34341 100644 > --- a/fs/inode.c > +++ b/fs/inode.c > @@ -2259,6 +2259,14 @@ int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa, > !S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode)) > return -EINVAL; > > + /* > + * It is only valid to set the DAX flag on regular files and > + * directories on filesystems. > + */ > + if ((fa->fsx_xflags & FS_XFLAG_DAX) && > + !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) > + return -EINVAL; > + > /* Extent size hints of zero turn off the flags. */ > if (fa->fsx_extsize == 0) > fa->fsx_xflags &= ~(FS_XFLAG_EXTSIZE | FS_XFLAG_EXTSZINHERIT); > > -- Jan Kara SUSE Labs, CR _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel