From patchwork Tue Sep 11 23:57:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 968759 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OGIy2qnn"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42920C5Bmzz9s3x for ; Wed, 12 Sep 2018 09:57:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726970AbeILE7K (ORCPT ); Wed, 12 Sep 2018 00:59:10 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:38823 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbeILE7K (ORCPT ); Wed, 12 Sep 2018 00:59:10 -0400 Received: by mail-pf1-f196.google.com with SMTP id x17-v6so51516pfh.5 for ; Tue, 11 Sep 2018 16:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=52c8wH46QIvOe2OR0QPg6mR1AhSRMpc+MjTizqMVlEQ=; b=OGIy2qnn3rJVgXFW8gp32v0eFk9/IDylO2ePxmavM87zn6SYPXSvhz2mv195UaCXIw B3debDCE1UdCN5oC6qp/KkfS4PYsII6/4jzOzWqWhONwpYfbLHFvGx0HYxcz6X6/P78q V3E2032f0hOWSsS3dUTRW4UDcfpfqoZi7RwSibZW1dxCE8ppJUP7tittjaO18ZetL3Fm zXAp/zDyYkRxaNHnIovwIfid393OHtnl5dn1jJsFniN4ASHXp8wNIs9a9i6NcE2oWuaE KMOMAxzSd3yGvoGHvBWCnnHIvj3i8ZkL8/ZeOyaeOvFxlTwW5Byufxi+qHAHIOsZtUB8 MloA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=52c8wH46QIvOe2OR0QPg6mR1AhSRMpc+MjTizqMVlEQ=; b=Si3E/1gevjcJcYC8woYKQe/f6d2t5AFxW5nH0OrtZAar47koCCl5pYAF+15dSxJuwa AIc7mcRyP5TiBf5dDsqP6PeyFA4REHAR0DUyXug9nIo+1X38cL+wjfypC4tyd9ZUgO1B lejt5FhkU+6yemLHp1IOU6JbBSsmFOIfDjz2OyVRGUbbZJd/RC7deQPlrOOPMKSvbnpV p3NNhLxwt8VFrgJHw4wbRInCo3t26t54iawtyToYCVR0QiUbkn6pb2B2fQeUwm2YzDl5 A1UGuufMHYvrJH4EajB5IGwNnBqPvNs4/R6ZwmG7AcOYveDzjcAcQIzah0CWsdqU3BU+ nVXQ== X-Gm-Message-State: APzg51DHV66Gbm2QPGYbCpe7G/5bkhA9SuVaEgiQop8bLYsqjpt1bwdH 1qB7ey79tpFAEU2ykMHuCfUg9WvX6Edq/Q== X-Google-Smtp-Source: ANB0VdZPT2fcicUc3jyEhsvJpBO18zh5+g2TtWp7/tRnJHYX/1HECBIMFbssyH8aTa1/x5r842kOUw== X-Received: by 2002:a62:2a48:: with SMTP id q69-v6mr32155167pfq.86.1536710250055; Tue, 11 Sep 2018 16:57:30 -0700 (PDT) Received: from localhost.localdomain (fs276ec80e.tkyc203.ap.nuro.jp. [39.110.200.14]) by smtp.gmail.com with ESMTPSA id u184-v6sm25858578pgd.46.2018.09.11.16.57.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 16:57:29 -0700 (PDT) From: Wang Shilong X-Google-Original-From: Wang Shilong To: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: dchinner@redhat.com, adilger@dilger.ca, wshilong@ddn.com Subject: [PATCH v2 2/3] ext4: fix to detect failure of dquot_initialize in project ioctl Date: Wed, 12 Sep 2018 08:57:17 +0900 Message-Id: <1536710238-16858-2-git-send-email-wshilong1991@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1536710238-16858-1-git-send-email-wshilong1991@gmail.com> References: <1536710238-16858-1-git-send-email-wshilong1991@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Wang Shilong We return most failure of dquota_initialize() except inode evict, this could make a bit sense, for example we allow file removal even quota files are broken? But it dosen't make sense to allow setting project if quota files etc are broken. Signed-off-by: Wang Shilong --- v1->v2: based it on one patchset, to make reviewers happy. --- fs/ext4/ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index f81102bd3203..781dd699bd7b 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -359,7 +359,9 @@ static int ext4_ioctl_setproject(struct file *filp, __u32 projid) brelse(iloc.bh); } - dquot_initialize(inode); + err = dquot_initialize(inode); + if (err) + return err; handle = ext4_journal_start(inode, EXT4_HT_QUOTA, EXT4_QUOTA_INIT_BLOCKS(sb) +