From ba02461e127603e12f20d8f557ae57ef6a5767dc Mon Sep 17 00:00:00 2001 From: dongjinlong Date: Tue, 26 Mar 2024 19:57:40 +0800 Subject: [PATCH] chore: remove repetitive words in comments Signed-off-by: dongjinlong --- g3doc/proposals/gsoc-2021-ideas.md | 2 +- pkg/bitmap/bitmap.go | 2 +- pkg/rand/rng.go | 2 +- pkg/sentry/fsimpl/devpts/queue.go | 2 +- pkg/sentry/fsimpl/fuse/fusefs.go | 2 +- pkg/sentry/fsimpl/kernfs/kernfs.go | 2 +- pkg/sentry/kernel/msgqueue/msgqueue.go | 4 ++-- pkg/sentry/kernel/task_start.go | 2 +- pkg/sentry/platform/systrap/context_queue.go | 2 +- pkg/sentry/vfs/mount.go | 2 +- pkg/tcpip/header/ndp_neighbor_advert.go | 2 +- pkg/tcpip/header/ndp_neighbor_solicit.go | 2 +- pkg/tcpip/header/ndp_router_advert.go | 2 +- pkg/tcpip/header/ndp_router_solicit.go | 2 +- .../network/internal/ip/generic_multicast_protocol_test.go | 2 +- pkg/tcpip/transport/tcp/connect.go | 2 +- pkg/test/testutil/testutil.go | 2 +- runsc/cmd/gofer.go | 2 +- runsc/specutils/specutils.go | 2 +- runsc/version_test.sh | 2 +- test/packetimpact/tests/udp_icmp_error_propagation_test.go | 2 +- test/runner/fuse/fuse.go | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) diff --git a/g3doc/proposals/gsoc-2021-ideas.md b/g3doc/proposals/gsoc-2021-ideas.md index ecaf0dfe1..96507aaa2 100644 --- a/g3doc/proposals/gsoc-2021-ideas.md +++ b/g3doc/proposals/gsoc-2021-ideas.md @@ -87,7 +87,7 @@ new syscalls: An `io_uring` request is effectively an opcode specifying the I/O operation to perform, and corresponding arguments. The opcodes and arguments closely relate -to the the corresponding synchronous I/O syscall. In addition, there are some +to the corresponding synchronous I/O syscall. In addition, there are some `io_uring`-specific arguments that specify things like how to process requests, how to interpret the arguments and communicate the status of the ring buffers. diff --git a/pkg/bitmap/bitmap.go b/pkg/bitmap/bitmap.go index 88d346bfd..b9eae562d 100644 --- a/pkg/bitmap/bitmap.go +++ b/pkg/bitmap/bitmap.go @@ -303,7 +303,7 @@ func (b *Bitmap) ToSlice() []uint32 { return bitmapSlice } -// GetNumOnes return the the number of ones in the Bitmap. +// GetNumOnes return the number of ones in the Bitmap. func (b *Bitmap) GetNumOnes() uint32 { return b.numOnes } diff --git a/pkg/rand/rng.go b/pkg/rand/rng.go index 5159c202a..ac2d0f8da 100644 --- a/pkg/rand/rng.go +++ b/pkg/rand/rng.go @@ -75,7 +75,7 @@ func (rg *RNG) Int63n(n int64) int64 { // - The remaining 20% map to the themselves - 2 * (maximum int64), // i.e. the first half of possible output values. // - // And thus 60% of results map the the first half of possible output + // And thus 60% of results map the first half of possible output // values, and 40% map the second half. Oops! // // We use the same trick as Go to deal with this: shave off the last diff --git a/pkg/sentry/fsimpl/devpts/queue.go b/pkg/sentry/fsimpl/devpts/queue.go index 877c2f58d..f4b116dd2 100644 --- a/pkg/sentry/fsimpl/devpts/queue.go +++ b/pkg/sentry/fsimpl/devpts/queue.go @@ -58,7 +58,7 @@ type queue struct { // so readable must be checked. readable bool - // transform is the the queue's function for transforming bytes + // transform is the queue's function for transforming bytes // entering the queue. For example, transform might convert all '\r's // entering the queue to '\n's. transformer diff --git a/pkg/sentry/fsimpl/fuse/fusefs.go b/pkg/sentry/fsimpl/fuse/fusefs.go index 97d25562a..3e743d452 100644 --- a/pkg/sentry/fsimpl/fuse/fusefs.go +++ b/pkg/sentry/fsimpl/fuse/fusefs.go @@ -53,7 +53,7 @@ type filesystemOptions struct { // gid of the mount owner. gid auth.KGID - // rootMode specifies the the file mode of the filesystem's root. + // rootMode specifies the file mode of the filesystem's root. rootMode linux.FileMode // maxActiveRequests specifies the maximum number of active requests that can diff --git a/pkg/sentry/fsimpl/kernfs/kernfs.go b/pkg/sentry/fsimpl/kernfs/kernfs.go index fb0da0629..215468147 100644 --- a/pkg/sentry/fsimpl/kernfs/kernfs.go +++ b/pkg/sentry/fsimpl/kernfs/kernfs.go @@ -742,7 +742,7 @@ type inodeRefs interface { type inodeMetadata interface { // CheckPermissions checks that creds may access this inode for the - // requested access type, per the the rules of + // requested access type, per the rules of // fs/namei.c:generic_permission(). CheckPermissions(ctx context.Context, creds *auth.Credentials, ats vfs.AccessTypes) error diff --git a/pkg/sentry/kernel/msgqueue/msgqueue.go b/pkg/sentry/kernel/msgqueue/msgqueue.go index a0f54e90a..206ceb0d6 100644 --- a/pkg/sentry/kernel/msgqueue/msgqueue.go +++ b/pkg/sentry/kernel/msgqueue/msgqueue.go @@ -194,7 +194,7 @@ func (r *Registry) newQueueLocked(ctx context.Context, key ipc.Key, creds *auth. // Remove removes the queue with specified ID. All waiters (readers and // writers) and writers will be awakened and fail. Remove will return an error -// if the ID is invalid, or the the user doesn't have privileges. +// if the ID is invalid, or the user doesn't have privileges. func (r *Registry) Remove(id ipc.ID, creds *auth.Credentials) error { r.mu.Lock() defer r.mu.Unlock() @@ -491,7 +491,7 @@ func (q *Queue) msgOfType(mType int64, except bool) *Message { return nil } -// msgOfTypeLessThan return the the first message with the lowest type less +// msgOfTypeLessThan return the first message with the lowest type less // than or equal to mType, nil if no such message exists. // // Precondition: caller must hold q.mu. diff --git a/pkg/sentry/kernel/task_start.go b/pkg/sentry/kernel/task_start.go index f4423f411..f6811a2f4 100644 --- a/pkg/sentry/kernel/task_start.go +++ b/pkg/sentry/kernel/task_start.go @@ -84,7 +84,7 @@ type TaskConfig struct { // MountNamespace is the MountNamespace of the new task. MountNamespace *vfs.MountNamespace - // RSeqAddr is a pointer to the the userspace linux.RSeq structure. + // RSeqAddr is a pointer to the userspace linux.RSeq structure. RSeqAddr hostarch.Addr // RSeqSignature is the signature that the rseq abort IP must be signed diff --git a/pkg/sentry/platform/systrap/context_queue.go b/pkg/sentry/platform/systrap/context_queue.go index 245c4ef92..892124c32 100644 --- a/pkg/sentry/platform/systrap/context_queue.go +++ b/pkg/sentry/platform/systrap/context_queue.go @@ -96,7 +96,7 @@ func (q *contextQueue) queuedContexts() uint32 { return (atomic.LoadUint32(&q.end) + maxContextQueueEntries - atomic.LoadUint32(&q.start)) % maxContextQueueEntries } -// add puts the the given ctx onto the context queue, and records a state of +// add puts the given ctx onto the context queue, and records a state of // the subprocess after insertion to see if there are more active stub threads // or more waiting contexts. func (q *contextQueue) add(ctx *sharedContext) *platform.ContextError { diff --git a/pkg/sentry/vfs/mount.go b/pkg/sentry/vfs/mount.go index 8790ffd2c..5beb58ff1 100644 --- a/pkg/sentry/vfs/mount.go +++ b/pkg/sentry/vfs/mount.go @@ -1532,7 +1532,7 @@ func manglePath(p string) string { return r.Replace(p) } -// superBlockOpts returns the super block options string for the the mount at +// superBlockOpts returns the super block options string for the mount at // the given path. func superBlockOpts(mountPath string, mnt *Mount) string { // Compose super block options by combining global mount flags with diff --git a/pkg/tcpip/header/ndp_neighbor_advert.go b/pkg/tcpip/header/ndp_neighbor_advert.go index beb7fff41..7af424056 100644 --- a/pkg/tcpip/header/ndp_neighbor_advert.go +++ b/pkg/tcpip/header/ndp_neighbor_advert.go @@ -104,7 +104,7 @@ func (b NDPNeighborAdvert) SetOverrideFlag(f bool) { } } -// Options returns an NDPOptions of the the options body. +// Options returns an NDPOptions of the options body. func (b NDPNeighborAdvert) Options() NDPOptions { return NDPOptions(b[ndpNAOptionsOffset:]) } diff --git a/pkg/tcpip/header/ndp_neighbor_solicit.go b/pkg/tcpip/header/ndp_neighbor_solicit.go index f39e06206..d571f91f6 100644 --- a/pkg/tcpip/header/ndp_neighbor_solicit.go +++ b/pkg/tcpip/header/ndp_neighbor_solicit.go @@ -46,7 +46,7 @@ func (b NDPNeighborSolicit) SetTargetAddress(addr tcpip.Address) { copy(b[ndpNSTargetAddessOffset:][:IPv6AddressSize], addr.AsSlice()) } -// Options returns an NDPOptions of the the options body. +// Options returns an NDPOptions of the options body. func (b NDPNeighborSolicit) Options() NDPOptions { return NDPOptions(b[ndpNSOptionsOffset:]) } diff --git a/pkg/tcpip/header/ndp_router_advert.go b/pkg/tcpip/header/ndp_router_advert.go index ef22b66f3..e2456c007 100644 --- a/pkg/tcpip/header/ndp_router_advert.go +++ b/pkg/tcpip/header/ndp_router_advert.go @@ -198,7 +198,7 @@ func (b NDPRouterAdvert) RetransTimer() time.Duration { return time.Millisecond * time.Duration(binary.BigEndian.Uint32(b[ndpRARetransTimerOffset:])) } -// Options returns an NDPOptions of the the options body. +// Options returns an NDPOptions of the options body. func (b NDPRouterAdvert) Options() NDPOptions { return NDPOptions(b[ndpRAOptionsOffset:]) } diff --git a/pkg/tcpip/header/ndp_router_solicit.go b/pkg/tcpip/header/ndp_router_solicit.go index 9e67ba95d..5ca2e5cf4 100644 --- a/pkg/tcpip/header/ndp_router_solicit.go +++ b/pkg/tcpip/header/ndp_router_solicit.go @@ -30,7 +30,7 @@ const ( ndpRSOptionsOffset = 4 ) -// Options returns an NDPOptions of the the options body. +// Options returns an NDPOptions of the options body. func (b NDPRouterSolicit) Options() NDPOptions { return NDPOptions(b[ndpRSOptionsOffset:]) } diff --git a/pkg/tcpip/network/internal/ip/generic_multicast_protocol_test.go b/pkg/tcpip/network/internal/ip/generic_multicast_protocol_test.go index 6e1ff80b3..6d021a5b1 100644 --- a/pkg/tcpip/network/internal/ip/generic_multicast_protocol_test.go +++ b/pkg/tcpip/network/internal/ip/generic_multicast_protocol_test.go @@ -1596,7 +1596,7 @@ func TestQueuedPackets(t *testing.T) { t.Errorf("mockMulticastGroupProtocol mismatch (-want +got):\n%s", diff) } - // Receiving a report should should transition us into the idle member state, + // Receiving a report should transition us into the idle member state, // even if we had a packet queued. We should no longer have any packets to // send. mgp.handleReport(addr1) diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go index 4a7297734..337116be7 100644 --- a/pkg/tcpip/transport/tcp/connect.go +++ b/pkg/tcpip/transport/tcp/connect.go @@ -97,7 +97,7 @@ type handshake struct { // hit. deferAccept time.Duration - // acked is true if the the final ACK for a 3-way handshake has + // acked is true if the final ACK for a 3-way handshake has // been received. This is required to stop retransmitting the // original SYN-ACK when deferAccept is enabled. acked bool diff --git a/pkg/test/testutil/testutil.go b/pkg/test/testutil/testutil.go index 8103e752b..bc4f2edc2 100644 --- a/pkg/test/testutil/testutil.go +++ b/pkg/test/testutil/testutil.go @@ -290,7 +290,7 @@ func NewSpecWithArgs(args ...string) *specs.Spec { }, // Root is readonly, but many tests want to write to tmpdir. // This creates a writable mount inside the root. Also, when tmpdir points - // to "/tmp", it makes the the actual /tmp to be mounted and not a tmpfs + // to "/tmp", it makes the actual /tmp to be mounted and not a tmpfs // inside the sentry. { Type: "bind", diff --git a/runsc/cmd/gofer.go b/runsc/cmd/gofer.go index 36ebd0dc4..729839a67 100644 --- a/runsc/cmd/gofer.go +++ b/runsc/cmd/gofer.go @@ -700,7 +700,7 @@ func adjustMountOptions(conf *config.Config, path string, opts []string) ([]stri // setFlags sets sync FD flags on the given FlagSet. func (g *goferSyncFDs) setFlags(f *flag.FlagSet) { f.IntVar(&g.nvproxyFD, "sync-nvproxy-fd", -1, "file descriptor that the gofer waits on until nvproxy setup is done") - f.IntVar(&g.usernsFD, "sync-userns-fd", -1, "file descriptor the the gofer waits on until userns mappings are set up") + f.IntVar(&g.usernsFD, "sync-userns-fd", -1, "file descriptor the gofer waits on until userns mappings are set up") f.IntVar(&g.procMountFD, "proc-mount-sync-fd", -1, "file descriptor that the gofer writes to when /proc isn't needed anymore and can be unmounted") } diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go index 615128489..1fe6a8556 100644 --- a/runsc/specutils/specutils.go +++ b/runsc/specutils/specutils.go @@ -254,7 +254,7 @@ func fixSpec(spec *specs.Spec, bundleDir string, conf *config.Config) error { } } else if len(containerName) > 0 { // If we know the container name, then check to see if seccomp - // instructions were given to the the container. + // instructions were given to the container. if annotation == annotationSeccomp+containerName && val == annotationSeccompRuntimeDefault { // Container seccomp rules are redundant when using gVisor, so remove // them when seccomp is set to RuntimeDefault. diff --git a/runsc/version_test.sh b/runsc/version_test.sh index 510b40a4f..5ac1f1259 100755 --- a/runsc/version_test.sh +++ b/runsc/version_test.sh @@ -19,7 +19,7 @@ set -euf -x -o pipefail readonly runsc="$1" readonly version=$($runsc --version) -# Version should should not match VERSION, which is the default and which +# Version should not match VERSION, which is the default and which # will also appear if something is wrong with workspace_status.sh script. if [[ $version =~ "VERSION" ]]; then echo "FAIL: Got bad version $version" diff --git a/test/packetimpact/tests/udp_icmp_error_propagation_test.go b/test/packetimpact/tests/udp_icmp_error_propagation_test.go index 556cee1d9..638ad6804 100644 --- a/test/packetimpact/tests/udp_icmp_error_propagation_test.go +++ b/test/packetimpact/tests/udp_icmp_error_propagation_test.go @@ -258,7 +258,7 @@ func TestUDPICMPErrorPropagation(t *testing.T) { if errDetect.useValidConn { // connClean is a UDP socket on the test runner that was not // involved in the generation of the ICMP error. As such, - // interactions between it and the the DUT should be independent of + // interactions between it and the DUT should be independent of // the ICMP error at least at the port level. connClean := dut.Net.NewUDPIPv4(t, testbench.UDP{DstPort: &remotePort}, testbench.UDP{SrcPort: &remotePort}) defer connClean.Close(t) diff --git a/test/runner/fuse/fuse.go b/test/runner/fuse/fuse.go index af985b976..4ce78d179 100644 --- a/test/runner/fuse/fuse.go +++ b/test/runner/fuse/fuse.go @@ -61,7 +61,7 @@ func main() { DirectMountStrict: true, Debug: *debug, AllowOther: true, - // SingleThreaded adds locking the the fuse server handler. We need to + // SingleThreaded adds locking the fuse server handler. We need to // enable this so that the go race detector doesn't detect a data race, even // if there isn't a logical race. SingleThreaded: true,