Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755169Ab2HON7B (ORCPT ); Wed, 15 Aug 2012 09:59:01 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:44595 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755138Ab2HON64 (ORCPT ); Wed, 15 Aug 2012 09:58:56 -0400 From: Miklos Szeredi To: viro@ZenIV.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, rjones@redhat.com, steveamigauk@yahoo.co.uk, mszeredi@suse.cz Subject: [PATCH 4/4] fuse: check create mode in atomic open Date: Wed, 15 Aug 2012 15:59:59 +0200 Message-Id: <1345039199-5904-5-git-send-email-miklos@szeredi.hu> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1345039199-5904-1-git-send-email-miklos@szeredi.hu> References: <1345039199-5904-1-git-send-email-miklos@szeredi.hu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 35 From: Miklos Szeredi Verify that the VFS is passing us a complete create mode with the S_IFREG to atomic open. Reported-by: Steve Reported-by: Richard W.M. Jones Signed-off-by: Miklos Szeredi Tested-by: Richard W.M. Jones --- fs/fuse/dir.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 8964cf3..324bc08 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -383,6 +383,9 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, struct fuse_entry_out outentry; struct fuse_file *ff; + /* Userspace expects S_IFREG in create mode */ + BUG_ON((mode & S_IFMT) != S_IFREG); + forget = fuse_alloc_forget(); err = -ENOMEM; if (!forget) -- 1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/