Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154280847
D36131.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36131.id.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
@@ -301,6 +301,21 @@
buf[n] = '\0';
}
+static void
+fs_populate_time(zfs_fs_t *fs, char *attrbuf, struct timespec *ts,
+ uint16_t ind, size_t *szp)
+{
+ uint64_t timebuf[2];
+
+ assert(ind < fs->sacnt);
+ assert(fs->saoffs[ind] != 0xffff);
+ assert(fs->satab[ind].size == sizeof(timebuf));
+
+ timebuf[0] = ts->tv_sec;
+ timebuf[1] = ts->tv_nsec;
+ fs_populate_attr(fs, attrbuf, timebuf, ind, szp);
+}
+
static void
fs_populate_sattrs(struct fs_populate_arg *arg, const fsnode *cur,
dnode_phys_t *dnode)
@@ -438,14 +453,10 @@
* We deliberately set atime = mtime here to ensure that images are
* reproducible.
*/
- assert(sizeof(sb->st_mtim) == fs->satab[ZPL_ATIME].size);
- fs_populate_attr(fs, attrbuf, &sb->st_mtim, ZPL_ATIME, &bonussz);
- assert(sizeof(sb->st_ctim) == fs->satab[ZPL_CTIME].size);
- fs_populate_attr(fs, attrbuf, &sb->st_ctim, ZPL_CTIME, &bonussz);
- assert(sizeof(sb->st_mtim) == fs->satab[ZPL_MTIME].size);
- fs_populate_attr(fs, attrbuf, &sb->st_mtim, ZPL_MTIME, &bonussz);
- assert(sizeof(sb->st_birthtim) == fs->satab[ZPL_CRTIME].size);
- fs_populate_attr(fs, attrbuf, &sb->st_birthtim, ZPL_CRTIME, &bonussz);
+ fs_populate_time(fs, attrbuf, &sb->st_mtim, ZPL_ATIME, &bonussz);
+ fs_populate_time(fs, attrbuf, &sb->st_ctim, ZPL_CTIME, &bonussz);
+ fs_populate_time(fs, attrbuf, &sb->st_mtim, ZPL_MTIME, &bonussz);
+ fs_populate_time(fs, attrbuf, &sb->st_birthtim, ZPL_CRTIME, &bonussz);
fs_populate_varszattr(fs, attrbuf, aces, sizeof(aces), 0,
ZPL_DACL_ACES, &bonussz);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 28, 2:05 PM (2 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32283677
Default Alt Text
D36131.id.diff (1 KB)
Attached To
Mode
D36131: makefs: Fix 32-bit issues in ZFS time attributes setting
Attached
Detach File
Event Timeline
Log In to Comment