linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
To: Li Xi <pkuelelixi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	tytso-3s7WtUTddSA@public.gmane.org,
	adilger-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org,
	jack-AlSwsSmVLrQ@public.gmane.org,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
	hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	dmonakhov-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org
Subject: Re: [v9 2/5] ext4: adds project ID support
Date: Mon, 16 Mar 2015 15:37:56 +0100	[thread overview]
Message-ID: <20150316143756.GO4934@quack.suse.cz> (raw)
In-Reply-To: <1426043003-31043-3-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>

On Wed 11-03-15 12:03:20, Li Xi wrote:
> This patch adds a new internal field of ext4 inode to save project
> identifier. Also a new flag EXT4_INODE_PROJINHERIT is added for
> inheriting project ID from parent directory.
> 
> Signed-off-by: Li Xi <lixi-LfVdkaOWEx8@public.gmane.org>
> Reviewed-by: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
...
> @@ -3395,6 +3405,13 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
>  	u8 new_file_type;
>  	int retval;
>  
> +	if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT)) &&
> +	    ((!projid_eq(EXT4_I(new_dir)->i_projid,
> +			 EXT4_I(old_dentry->d_inode)->i_projid)) ||
> +	     (!projid_eq(EXT4_I(old_dir)->i_projid,
> +			 EXT4_I(new_dentry->d_inode)->i_projid))))
> +		return -EXDEV;
> +
  I believe this needs to also check EXT4_INODE_PROJINHERIT on old_dir. So
something like:
	if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) &&
	     !projid_eq(EXT4_I(new_dir)->i_projid,
			 EXT4_I(old_dentry->d_inode)->i_projid)) ||
	    (ext4_test_inode_flag(old_dir, EXT4_INODE_PROJINHERIT) &&
	     !projid_eq(EXT4_I(old_dir)->i_projid,
			 EXT4_I(new_dentry->d_inode)->i_projid)))
		return -EXDEV;

								Honza
-- 
Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
SUSE Labs, CR

  parent reply	other threads:[~2015-03-16 14:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11  3:03 [v9 0/5] ext4: add project quota support Li Xi
2015-03-11  3:03 ` [v9 2/5] ext4: adds project ID support Li Xi
     [not found]   ` <1426043003-31043-3-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>
2015-03-16 14:37     ` Jan Kara [this message]
     [not found] ` <1426043003-31043-1-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>
2015-03-11  3:03   ` [v9 1/5] vfs: adds general codes to enforces project quota limits Li Xi
2015-03-16 14:29     ` Jan Kara
2015-03-16 21:49       ` Dave Chinner
2015-03-17  9:37         ` Jan Kara
2015-03-11  3:03   ` [v9 3/5] ext4: adds project quota support Li Xi
     [not found]     ` <1426043003-31043-4-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>
2015-03-11  7:40       ` Konstantin Khlebnikov
2015-03-11  3:03   ` [v9 4/5] ext4: adds FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support Li Xi
     [not found]     ` <1426043003-31043-5-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>
2015-03-11  7:33       ` Konstantin Khlebnikov
2015-03-16 15:26       ` Jan Kara
2015-03-11  3:03 ` [v9 5/5] ext4: cleanup inode flag definitions Li Xi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150316143756.GO4934@quack.suse.cz \
    --to=jack-alswssmvlrq@public.gmane.org \
    --cc=adilger-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org \
    --cc=dmonakhov-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pkuelelixi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tytso-3s7WtUTddSA@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).