From patchwork Wed May 20 00:43:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 6441281 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 605F0C0432 for ; Wed, 20 May 2015 00:44:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9719A203B7 for ; Wed, 20 May 2015 00:44:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0992203DA for ; Wed, 20 May 2015 00:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752570AbbETAnp (ORCPT ); Tue, 19 May 2015 20:43:45 -0400 Received: from mail.kernel.org ([198.145.29.136]:50694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbbETAnl (ORCPT ); Tue, 19 May 2015 20:43:41 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A2FC203DF; Wed, 20 May 2015 00:43:40 +0000 (UTC) Received: from localhost (unknown [166.170.43.138]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9645C20254; Wed, 20 May 2015 00:43:39 +0000 (UTC) From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 3/4] f2fs crypto: check encryption for tmpfile Date: Tue, 19 May 2015 17:43:25 -0700 Message-Id: <1432082606-55975-3-git-send-email-jaegeuk@kernel.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1432082606-55975-1-git-send-email-jaegeuk@kernel.org> References: <1432082606-55975-1-git-send-email-jaegeuk@kernel.org> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds to check encryption for tmpfile in early stage. Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index dded2b0..47066b0 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -531,6 +531,11 @@ static int __f2fs_tmpfile(struct inode *dir, struct dentry *dentry, } f2fs_lock_op(sbi); + + err = f2fs_get_encryption_info(dir); + if (err) + goto out; + err = acquire_orphan_inode(sbi); if (err) goto out;