VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Miklos Szeredi <mszeredi@redhat.com> 2020-05-14 16:44:23 +0200 committer: Miklos Szeredi <mszeredi@redhat.com> 2020-05-14 16:44:23 +0200 commit: a3c751a50fe6bbe50eb7622a14b18b361804ee0c parent: 0e698dfa282211e414076f9dc7e83c1c288314fd
Commit Summary:
vfs: allow unprivileged whiteout creation
Diffstat:
1 file changed, 3 insertions, 0 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index c5e6eff5a381..ba0ded7842a7 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -483,6 +483,9 @@ int cdev_add(struct cdev *p, dev_t dev, unsigned count)
 	p->dev = dev;
 	p->count = count;
 
+	if (WARN_ON(dev == WHITEOUT_DEV))
+		return -EBUSY;
+
 	error = kobj_map(cdev_map, dev, count, NULL,
 			 exact_match, exact_lock, p);
 	if (error)