Page MenuHomeFreeBSD

rmacklem (Rick Macklem)
User

Projects

User Details

User Since
Jan 13 2015, 10:58 PM (239 w, 5 d)

Recent Activity

Today

rmacklem committed rS351202: Add an entry to RELNOTES for r351201..
Add an entry to RELNOTES for r351201.
Mon, Aug 19, 12:46 AM
rmacklem closed D21299: Add a vop_stdioctl() that does the trivial algorithm for FIOSEEKDATA/FIOSEEKHOLE.
Mon, Aug 19, 12:29 AM
rmacklem committed rS351201: Add a vop_stdioctl() that performs a trivial FIOSEEKDATA/FIOSEEKHOLE..
Add a vop_stdioctl() that performs a trivial FIOSEEKDATA/FIOSEEKHOLE.
Mon, Aug 19, 12:29 AM

Yesterday

rmacklem added a comment to D21299: Add a vop_stdioctl() that does the trivial algorithm for FIOSEEKDATA/FIOSEEKHOLE.

This version of the patch has the changes suggested by kib@ incorporated in it.
The only semantic change is that it now returns whatever error VOP_GETATTR()
returns if VOP_GETATTR() fails. This is consistent with the behaviour of vn_bmap_seekhole().

Sun, Aug 18, 1:50 AM

Sat, Aug 17

rmacklem created D21300: Fix lseek() so that it never returns errnos not listed on the man page, such as ENOTTY.
Sat, Aug 17, 3:24 AM
rmacklem created D21299: Add a vop_stdioctl() that does the trivial algorithm for FIOSEEKDATA/FIOSEEKHOLE.
Sat, Aug 17, 3:17 AM

Thu, Aug 15

rmacklem committed rS351106: Fix copy_file_range(2) so that unneeded blocks are not allocated to the output….
Fix copy_file_range(2) so that unneeded blocks are not allocated to the output…
Thu, Aug 15, 11:21 PM
rmacklem closed D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file.
Thu, Aug 15, 11:21 PM

Mon, Aug 12

rmacklem committed rS350884: Add support for the Seek operation to the NFSv4.2 client and server..
Add support for the Seek operation to the NFSv4.2 client and server.
Mon, Aug 12, 5:25 AM

Thu, Aug 8

rmacklem added a comment to D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file.

Only change is a modified comment explaining how FIOSEEKHOLE might
find the same offset as FIOSEEKDATA already has returned for the file.

Thu, Aug 8, 10:56 PM
rmacklem committed rS350777: Remove some harmless cruft from vn_generic_copy_file_range()..
Remove some harmless cruft from vn_generic_copy_file_range().
Thu, Aug 8, 8:07 PM
rmacklem committed rS350776: Fix copy_file_range(2) for an unlikely race during hole finding..
Fix copy_file_range(2) for an unlikely race during hole finding.
Thu, Aug 8, 7:53 PM

Mon, Aug 5

rmacklem committed rS350580: Fix the NFSv4.2 client Copy operation's handling of a stale write verifier..
Fix the NFSv4.2 client Copy operation's handling of a stale write verifier.
Mon, Aug 5, 2:53 AM

Sun, Aug 4

rmacklem added a comment to D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file.

This version of the patch adds an additional sanity check for
the results from VOP_IOCTL(). This change can only have an effect
for a non-INVARIANTS kernel where one of the VOP_IOCTL()s
return a bogus offset.
It ensures a reasonable positive value for xfer2 is returned for this case.

Sun, Aug 4, 10:10 PM
rmacklem added a comment to D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file.

Replied to inline comment.

Sun, Aug 4, 9:27 PM
rmacklem added a comment to D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file.

This version of the patch has the INVARIANTS printf() replaced by a KASSERT().
It also has KASSERT()s added for the results of FIOSEEKDATA/FIOSEEKHOLE.

Sun, Aug 4, 4:32 PM
rmacklem added a comment to D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file.

Replied to kib@'s comments inline.

Sun, Aug 4, 3:16 PM
rmacklem created D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file.
Sun, Aug 4, 1:07 AM

Fri, Aug 2

rmacklem committed rS350528: MFC: r350367.
MFC: r350367
Fri, Aug 2, 2:00 AM

Wed, Jul 31

rmacklem committed rS350491: Add an entry for the copy_file_range(2) syscall..
Add an entry for the copy_file_range(2) syscall.
Wed, Jul 31, 11:36 PM

Mon, Jul 29

rmacklem committed rS350398: Fix IO Advise, Layout error and Layout stats to not do vn_start_write()..
Fix IO Advise, Layout error and Layout stats to not do vn_start_write().
Mon, Jul 29, 1:01 AM

Sun, Jul 28

rmacklem committed rS350397: Return NFSERR_NOTSUPP for the NFSv4.2 Copy operation if a pNFS server..
Return NFSERR_NOTSUPP for the NFSv4.2 Copy operation if a pNFS server.
Sun, Jul 28, 10:01 PM
rmacklem committed rS350395: Fix printing of Server Re-Failed and Server Faults..
Fix printing of Server Re-Failed and Server Faults.
Sun, Jul 28, 9:44 PM
rmacklem added a comment to D21092: freebsd32 shims for copy_file_range(2).

I don't really know anything about this, but it looks fine to me.
The only change is uint32_t replaces size_t, which makes sense to 32bits.
(I'm guessing this is only used for amd64, where "int" and "unsigned int"
remain 32bits.)

Sun, Jul 28, 1:35 AM

Sat, Jul 27

rmacklem committed rS350368: Merge in an up to date kernel from head..
Merge in an up to date kernel from head.
Sat, Jul 27, 2:23 AM
rmacklem committed rS350367: Lock the vnode before calling ufs_bmap_seekdata()..
Lock the vnode before calling ufs_bmap_seekdata().
Sat, Jul 27, 1:52 AM

Fri, Jul 26

rmacklem committed rS350337: Add support for Copy (the intra-server case) to the NFSv4.2 client and server..
Add support for Copy (the intra-server case) to the NFSv4.2 client and server.
Fri, Jul 26, 12:28 AM

Thu, Jul 25

rmacklem committed rS350326: Merge in an up to date kernel from head..
Merge in an up to date kernel from head.
Thu, Jul 25, 4:35 PM
rmacklem committed rS350321: r350320 committed the wrong version of generated syscall.mk..
r350320 committed the wrong version of generated syscall.mk.
Thu, Jul 25, 6:48 AM
rmacklem committed rS350320: Update the generated syscall.mk for copy_file_range(2)..
Update the generated syscall.mk for copy_file_range(2).
Thu, Jul 25, 6:35 AM
rmacklem committed rS350319: Create a man page for VOP_COPY_FILE_RANGE(9)..
Create a man page for VOP_COPY_FILE_RANGE(9).
Thu, Jul 25, 6:20 AM
rmacklem committed rS350318: Add an entry for copy_file_range(2) to unistd.h..
Add an entry for copy_file_range(2) to unistd.h.
Thu, Jul 25, 6:11 AM
rmacklem committed rS350317: Add libc support for the copy_file_range(2) syscall added by r350315..
Add libc support for the copy_file_range(2) syscall added by r350315.
Thu, Jul 25, 6:06 AM
rmacklem committed rS350316: Update the generated syscall files for copy_file_range(2) added by.
Update the generated syscall files for copy_file_range(2) added by
Thu, Jul 25, 5:56 AM
rmacklem closed D20584: add a linux compatible copy_file_range(2) syscall.
Thu, Jul 25, 5:46 AM
rmacklem committed rS350315: Add kernel support for a Linux compatible copy_file_range(2) syscall..
Add kernel support for a Linux compatible copy_file_range(2) syscall.
Thu, Jul 25, 5:46 AM

Mon, Jul 22

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Marked done and replied to inline comments.

Mon, Jul 22, 3:57 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

This version incorporates a change to VOP_COPY_FILE_RANGE.9 suggested by asomers@.

Mon, Jul 22, 3:50 PM
D20584: add a linux compatible copy_file_range(2) syscall now requires review to proceed.

This updates incorporates changes suggested by kib@.
Replace 1048576 with 1024 * 1024 for readability and move
vn_generic_copy_file_range() and helper functions from
vfs_subr.c to vfs_vnops.c.

Mon, Jul 22, 3:19 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Replied and checked done to inline comments.

Mon, Jul 22, 3:55 AM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

This version incorporates changes suggested by asomers@.

Mon, Jul 22, 3:27 AM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

The previous version of the patch had a single bwillwrite() call before the copy
done by the VOP call or vn_generic_copy_file_range().
kib@ pointed out that bwillwrite() calls are needed in the copy loop, which makes
sense, since the copy loop could be writing a large amount of data and constipate
the buffer cache for file systems using it.

Mon, Jul 22, 1:58 AM

Jul 18 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

vn_copy_file_range() erroneously returned the error with *lenp set to the requested
length instead of 0 (the number of bytes copied).
This version of the patch has this fixed and a couple of extraneous brackets removed.

Jul 18 2019, 4:05 PM

Jul 13 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

One minor additional fix. For the case where the "len" argument is 0, the Linux
syscall returns 0. The previous patch did that, but it did 0 length (ie. start and end equal)
range locks, which the range lock code doesn't handle correctly.

Jul 13 2019, 11:40 PM

Jul 7 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Marked "check for flags == 0" as done on the inline comment.

Jul 7 2019, 9:16 PM

Jul 6 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

This version of the patch checks for flags == 0 and returns EINVAL when not 0.
It also documents "must be 0" in the man page. This change seemed to be the
consensus from a discussion on FreeBSD-current@.

Jul 6 2019, 12:26 AM

Jul 5 2019

rmacklem committed rS349772: MFC: r348590, r348591.
MFC: r348590, r348591
Jul 5 2019, 10:48 PM
rmacklem committed rS349771: MFC: r348590, r348591.
MFC: r348590, r348591
Jul 5 2019, 10:36 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Taken comment w.r.t. handling of flags argument over to freebsd-current@, since more people will see it there.

Jul 5 2019, 3:20 PM
rmacklem committed rS349756: MFC: r348452.
MFC: r348452
Jul 5 2019, 1:05 AM
rmacklem committed rS349755: MFC: r348452.
MFC: r348452
Jul 5 2019, 12:55 AM

Jul 3 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

One more bug found while proofreading the code.

  • It erroneously used inoffp instead of outoffp when calculating the size of hole to write. My main test program copies byte ranges of a file and then compares the file, so inoff and outoff are the same. I did run a small test program copying from/to different offsets, but the file had data so I could easily check if it worked.

This version of the patch has this fixed. It also has a minor optimization, where it uses vn_truncate_locked() to grow the
output file when a hole is at the end of the range and the hole is entirely beyond the original EOF for the output file
instead of writing 0 bytes to grow the file.

Jul 3 2019, 9:14 PM

Jul 2 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Marked inline comments as done.

Jul 2 2019, 2:56 AM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Made a minor change to VOP_COPY_FILE_RANGE.9 as recommended by asomers@.

Jul 2 2019, 2:53 AM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

This version of the patch incorporates the changes recommended by kib@.
I have also added a couple of sentences related to copying sparse files to copy_file_range.2.

Jul 2 2019, 2:41 AM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

More fixes. When testing using a file with a large (> 4Gbyte) hole in it, a couple
of bugs needed to be fixed.

  • If the "len" argument is > SSIZE_MAX, it can't be returned --> clip "len" at SSIZE_MAX
  • If the hole size is greater than what can be stored in size_t… --> change xfer, xfer2 to off_t
  • If the hole extended past the end of the range being copied, xfer was set too large and would cause the len variable to wrap around. --> clip xfer at len after being calculated as the hole size.
Jul 2 2019, 1:44 AM

Jul 1 2019

rmacklem closed D20808: factor out the code that actually does the truncation from vn_truncate() into vn_truncate_locked().
Jul 1 2019, 8:42 PM
rmacklem committed rS349582: Factor out the code that does a VOP_SETATTR(size) from vn_truncate()..
Factor out the code that does a VOP_SETATTR(size) from vn_truncate().
Jul 1 2019, 8:42 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

This variant of the patch has the rangelock code moved from vn_copy_file_range() to
kern_copy_file_range(). The reason I did this is that the NFSv4.2 server needs to lock
the file ranges slightly differently (for the "to EOF" case) and I wanted it to be able
to call vn_copy_file_range() to do most of the work.

Jul 1 2019, 2:00 AM

Jun 30 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

This version of the patch uses vn_truncate_locked(), which is created by D20808.
There should be no semantic change from the previous variant of the patch.

Jun 30 2019, 12:40 AM
rmacklem created D20808: factor out the code that actually does the truncation from vn_truncate() into vn_truncate_locked().
Jun 30 2019, 12:26 AM

Jun 27 2019

rmacklem committed rS349476: Add non-blocking trylock variants for the rangelock functions..
Add non-blocking trylock variants for the rangelock functions.
Jun 27 2019, 11:10 PM
rmacklem closed D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().
Jun 27 2019, 11:10 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Adjust patch to use the vn_rangelock_tryrlock() naming now used by D20645.

Jun 27 2019, 10:32 PM
D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock() now requires review to proceed.

This version of the patch incorporates kib@'s suggestions.

Jun 27 2019, 10:09 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

bwillwrite() call added.
VOP_ADD_WRITECOUNT() added around VOP_SETATTR() of size.

Jun 27 2019, 3:46 AM

Jun 22 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

I've taken the "pig picture" discussion related to Sean's points over to the freebsd-fs@freebsd.org
mailing list. (I tried to add that mailing list when I first put this patch in phabricator, but it would only
seem to accept freebsd-bugs@ for some reason.)
Sean, the email I had for you didn't work, so please go look at the mailing list.

Jun 22 2019, 4:07 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Added inline comment w.r.t. handling of errors returned by VOP_COPY_FILE_RANGE().

Jun 22 2019, 2:16 AM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

The code that did the actual copying, which was after the VOP_COPY_FILE_RANGE() call in
vn_copy_file_range() is now factored out into a separate function called vn_generic_copy_file_range().
This allows the vn_generic_copy_range() call to be done from within a VOP_COPY_FILE_RANGE() and,
in fact, vop_stdcopy_file_range() does just that.

Jun 22 2019, 12:46 AM

Jun 19 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Replied to some inline comments.

Jun 19 2019, 11:48 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

This version of the patch incorporates some of asomers@ suggestions.

Jun 19 2019, 11:30 PM

Jun 18 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

One more patch update. This one is an optimization. If a hole is found that extends to
the end of the byte range being copied, all subsequent reads will return all 0 bytes.
This patch adds a Boolean variable called readzeros to flag this case and avoid doing
the unnecessary reads.

Jun 18 2019, 5:05 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Oops, found one more bug during proofreading. If the hole being punched by writing 0s was
greater than blksize in length, the memset() would have gone off the end of the dat buffer.
This version has the above fixed. To make the code cleaner, I factored out the writing of a chunk
of outvp into a separate function.

Jun 18 2019, 2:17 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

During a proofread, I spotted that vn_copy_file_range() was broken if the input file had a hole
that straddled the end of the byte range being copied.
This version of the patch has that fixed, plus a typo in a comment and little bit or reordering
of the code (that doesn't affect correctness).

Jun 18 2019, 1:36 AM

Jun 17 2019

rmacklem committed rS349128: MFC: r347583.
MFC: r347583
Jun 17 2019, 12:59 AM
rmacklem committed rS349127: MFC: r347583.
MFC: r347583
Jun 17 2019, 12:38 AM
rmacklem committed rS349126: MFC: r347498.
MFC: r347498
Jun 17 2019, 12:29 AM
rmacklem committed rS349125: MFC: r347498.
MFC: r347498
Jun 17 2019, 12:20 AM
rmacklem committed rS349124: MFC: r347476.
MFC: r347476
Jun 17 2019, 12:12 AM
rmacklem committed rS349123: MFC: r347476.
MFC: r347476
Jun 17 2019, 12:00 AM

Jun 16 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Change the mem_iszero() helper function to return bool instead of int, since C99 bool is now fashionable
in the FreeBSD kernel.

Jun 16 2019, 3:00 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Changed an int to a bool, since C99 bools now appear to be fashionable in the FreeBSD kernel.

Jun 16 2019, 2:27 PM
rmacklem added inline comments to D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().
Jun 16 2019, 5:14 AM
rmacklem added a comment to D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().

int arguments changed to C99 bool as requested by kib@.

Jun 16 2019, 5:12 AM

Jun 15 2019

rmacklem added a comment to D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().

Added replies to inline comments.

Jun 15 2019, 11:23 PM
rmacklem added a comment to D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().

This variant allows a sleep to be done for allocation of a new list entry. It only returns NULL
if it would need to sleep waiting to be able to lock the range.

Jun 15 2019, 11:20 PM
rmacklem updated the diff for D20584: add a linux compatible copy_file_range(2) syscall.

Replace vn_rangelock_rlock_nonblock() with vn_rangelock_rlock_trylock() to be consistent with D20645.

Jun 15 2019, 5:50 AM
rmacklem updated the diff for D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().

This variant of the patch has the "_nonblock" suffixes replaced by "_trylock" as suggested by asomers@.
A quick grep of src/sys/sys shows that "nonblock" is used for flags, but "_trylock" is used as a suffix
for non-blocking lock functions.

Jun 15 2019, 5:35 AM
rmacklem updated the diff for D20584: add a linux compatible copy_file_range(2) syscall.

This variant of the patch rangelocks the byte ranges for both the input and output files.
It uses the vn_rangelock_rlock_nonblock() call in the D20645 patch to do this without a
risk of deadlock.

Jun 15 2019, 1:51 AM
rmacklem created D20645: add non-blocking variants of rangelock_rlock() and rangelock_wlock().
Jun 15 2019, 12:29 AM

Jun 13 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Added inline replies to the inline comments that still apply to this version.

Jun 13 2019, 11:24 PM
rmacklem updated the diff for D20584: add a linux compatible copy_file_range(2) syscall.

This version of the patch avoids the problems w.r.t. concurrent locking of two vnodes
by locking/unlocking the vnodes (which also implies rangelocks and vn_start_write())
in vn_rdwr().

Jun 13 2019, 11:00 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

I am going to take the "does this sycall need to be atomic?" over to FreeBSD-fs@.
(I will copy kib@'s and asomers@ comments into the post.)

Jun 13 2019, 9:15 PM

Jun 11 2019

rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Yes, I did understand the comment w.r.t. range_locks. I fixed the rest of the stuff for two vnodes locked
concurrently, but I couldn't see an easy way to do range_locks on both of them without a LOR.

Jun 11 2019, 4:27 PM
rmacklem added a comment to D20584: add a linux compatible copy_file_range(2) syscall.

Added a question w.r.t. which way I should handle the locking of the two vnodes.

Jun 11 2019, 12:33 AM

Jun 10 2019

rmacklem created D20584: add a linux compatible copy_file_range(2) syscall.
Jun 10 2019, 1:20 AM

Jun 3 2019

rmacklem committed rS348591: r348590 had mention of "-I" in a comment that no longer applied to the patch..
r348590 had mention of "-I" in a comment that no longer applied to the patch.
Jun 3 2019, 11:07 PM
rmacklem closed D20487: add a new -I command line option to mountd which makes it update the kernel exports incrementally upon a reload.
Jun 3 2019, 10:59 PM
rmacklem committed rS348590: Modify mountd so that it incrementally updates the kernel exports upon a reload..
Modify mountd so that it incrementally updates the kernel exports upon a reload.
Jun 3 2019, 10:59 PM

Jun 2 2019

rmacklem added a comment to D20487: add a new -I command line option to mountd which makes it update the kernel exports incrementally upon a reload.

The COMPARE_ARRAYS() macro has been changed per suggestions by kib@.

Jun 2 2019, 10:04 PM