From patchwork Fri Mar 1 14:05:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 10835479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C5971880 for ; Fri, 1 Mar 2019 14:06:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E9D22F245 for ; Fri, 1 Mar 2019 14:06:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82E892F20D; Fri, 1 Mar 2019 14:06:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A4352F25A for ; Fri, 1 Mar 2019 14:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388705AbfCAOGA (ORCPT ); Fri, 1 Mar 2019 09:06:00 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40105 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387836AbfCAOGA (ORCPT ); Fri, 1 Mar 2019 09:06:00 -0500 Received: by mail-pf1-f195.google.com with SMTP id h1so11485495pfo.7; Fri, 01 Mar 2019 06:05:59 -0800 (PST) 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=dNvrqz8W2pGUfo3r5kGYI6TG6CApMjIeNboQwS8ZZkU=; b=exlkfKaa5sFT77GYbt5GRit2amWQuXjrWQmz3S0pewNX5P5YykB2fR5qLAi2JFZHLH YlIVYFkj9Ep6uPQwCc5HkVuPC3BE7wJ/huD3BmsKx7rf3CViH/GLz16pVhCIwKbeJUHx 3uSROEfRI8d6PoAFLHe4+5w5CU/0AwlWGgQ1gqA1H4SE6Hoi1Q+SFm5ZYT18C6CGBjFE CmvMbR3iAcgtavS9n20AEwjyTeuVz5XTggnKGfAVseHuW0qybuPWL6IiUMOC0x/yFv/p egcqN6w9NqIgnM+yppLNv1/e4Yq5sy8pA57amWTFS1xRCaxW7hIlILMw1oqyjq+YdrpD Xupg== 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=dNvrqz8W2pGUfo3r5kGYI6TG6CApMjIeNboQwS8ZZkU=; b=HuqQc+Zzj6+4tjWPJff8u/VDRINIjIh9Dm6orICsf3n21QKrCca3mOhzN9h7k3dtWQ 246+ywOQrV4eh+B7pRc+8AjniV6W5KM+t4lIJv/VyKeBCuNzjAgN7qcdkcxrgy/DDSo5 Kl6d6VmxzbGMhpnuiKwQfozK+C3Nm0bxuhItFKyjhbrj7nnZHTPZ1Qat9LmVpwzuyq2K NglS+f3+vpJQQiPLubxoT7P1aMfQ/Fcn5s5w+pOLpXG5/lqzyIjrnt/aq2U/zvvISSuo QHN36IreUSGRA39UrVKdCuuH4cEtfQub7e0BKD0SpOAoZa83Ad/Y9RUQIzTgKVkjBjFz ZuqA== X-Gm-Message-State: APjAAAU9bXjAxrqFDSqtGw6eCtQ34pRab+jSDMmihLHrJtPupME+YKRC EHeDtYg6LsUVCMStttS3/oh/f9S6 X-Google-Smtp-Source: APXvYqyLaLAUDlXplLOzKyuqdb2QSgRnuNUsPEcmA9Ea68eiHEeuZosC1fFzJBjzU1uif5o8n944Qg== X-Received: by 2002:a65:4243:: with SMTP id d3mr4986129pgq.56.1551449159212; Fri, 01 Mar 2019 06:05:59 -0800 (PST) Received: from localhost.localdomain (fs276ec80e.tkyc203.ap.nuro.jp. [39.110.200.14]) by smtp.gmail.com with ESMTPSA id a184sm12458089pge.68.2019.03.01.06.05.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Mar 2019 06:05:58 -0800 (PST) From: Wang Shilong X-Google-Original-From: Wang Shilong To: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: lixi@ddn.com, adilger@dilger.ca, Wang Shilong Subject: [PATCH 3/8] f2fs: support project ID in f2fs_setattr() Date: Fri, 1 Mar 2019 23:05:36 +0900 Message-Id: <1551449141-7884-4-git-send-email-wshilong1991@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1551449141-7884-1-git-send-email-wshilong1991@gmail.com> References: <1551449141-7884-1-git-send-email-wshilong1991@gmail.com> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wang Shilong From: Wang Shilong Signed-off-by: Wang Shilong --- fs/f2fs/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index bba56b39dcc5..8eaca056e857 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -789,7 +789,9 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) if ((attr->ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, inode->i_uid)) || (attr->ia_valid & ATTR_GID && - !gid_eq(attr->ia_gid, inode->i_gid))) { + !gid_eq(attr->ia_gid, inode->i_gid)) || + (attr->ia_valid & ATTR_PROJID && + !projid_eq(attr->ia_projid, F2FS_I(inode)->i_projid))) { f2fs_lock_op(F2FS_I_SB(inode)); err = dquot_transfer(inode, attr); if (err) { @@ -806,6 +808,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) inode->i_uid = attr->ia_uid; if (attr->ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; + if (attr->ia_valid & ATTR_PROJID) + F2FS_I(inode)->i_projid = attr->ia_projid; f2fs_mark_inode_dirty_sync(inode, true); f2fs_unlock_op(F2FS_I_SB(inode)); }