projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f866870
)
bcachefs: Don't allow hardlinks when inherited attrs would change
author
Kent Overstreet
<kent.overstreet@linux.dev>
Wed, 12 Oct 2022 20:12:27 +0000
(16:12 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:43 +0000
(17:09 -0400)
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>
fs/bcachefs/fs-common.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/fs-common.c
b/fs/bcachefs/fs-common.c
index 53ffc684223cf30486693f615b6de27054de347b..e9dd1d13ec7e97d39acf2b2472092934b06508b5 100644
(file)
--- a/
fs/bcachefs/fs-common.c
+++ b/
fs/bcachefs/fs-common.c
@@
-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);