mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
bcachefs: Don't allow hardlinks when inherited attrs would change
This is the right thing to do, and conforms with our own behaviour on rename and xfs's behaviour on hardlink. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
f866870f5d
commit
bf9cb250ed
1 changed files with 5 additions and 0 deletions
|
@ -212,6 +212,11 @@ int bch2_link_trans(struct btree_trans *trans,
|
|||
if (ret)
|
||||
goto err;
|
||||
|
||||
if (bch2_reinherit_attrs(inode_u, dir_u)) {
|
||||
ret = -EXDEV;
|
||||
goto err;
|
||||
}
|
||||
|
||||
dir_u->bi_mtime = dir_u->bi_ctime = now;
|
||||
|
||||
dir_hash = bch2_hash_info_init(c, dir_u);
|
||||
|
|
Loading…
Add table
Reference in a new issue