Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150467941
D38029.id115001.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
958 B
Referenced Files
None
Subscribers
None
D38029.id115001.diff
View Options
diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c
--- a/usr.sbin/makefs/zfs/fs.c
+++ b/usr.sbin/makefs/zfs/fs.c
@@ -292,6 +292,16 @@
return (fd);
}
+static int
+fs_open_can_fail(const fsnode *cur, struct fs_populate_arg *arg, int flags)
+{
+ char path[PATH_MAX];
+
+ fs_populate_path(cur, arg, path, sizeof(path), &fd);
+
+ return (openat(fd, path, flags));
+}
+
static void
fs_readlink(const fsnode *cur, struct fs_populate_arg *arg,
char *buf, size_t bufsz)
@@ -590,7 +600,12 @@
*/
if (!SLIST_EMPTY(&arg->dirs)) {
fs_populate_dirent(arg, cur, dnid);
- dirfd = fs_open(cur, arg, O_DIRECTORY | O_RDONLY);
+ /*
+ * We only need the directory fd if we're finding files in
+ * it. If it's just there for other directories or
+ * files using contents= we don't need to succeed here.
+ */
+ dirfd = fs_open_can_fail(cur, arg, O_DIRECTORY | O_RDONLY);
} else {
arg->rootdirid = dnid;
dirfd = arg->rootdirfd;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 2, 11:38 AM (12 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30720753
Default Alt Text
D38029.id115001.diff (958 B)
Attached To
Mode
D38029: makefs: don't needlessly require directories to exist
Attached
Detach File
Event Timeline
Log In to Comment