mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Get HardLink test in //runsc/fsgofer:lisafs_test to pass.
This test was attempting to create a link with the same name as the target. Changed that to use a different name for link. This test also exposed a ref count bug in LISAFS RPC handlers. Fixed that. Updates #8688 PiperOrigin-RevId: 516912550
This commit is contained in:
@@ -892,6 +892,7 @@ func LinkAtHandler(c *Connection, comm Communicator, payloadLen uint32) (uint32,
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
defer targetFD.DecRef(nil)
|
||||
if targetFD.IsDir() {
|
||||
// Can not create hard link to directory.
|
||||
return 0, unix.EPERM
|
||||
|
||||
@@ -490,7 +490,8 @@ func testHardLink(ctx context.Context, t *testing.T, tester Tester, root lisafs.
|
||||
defer closeFD(ctx, t, fd)
|
||||
defer unix.Close(hostFD)
|
||||
|
||||
link, linkStat := link(ctx, t, root, name, controlFile)
|
||||
linkName := "linkFile"
|
||||
link, linkStat := link(ctx, t, root, linkName, controlFile)
|
||||
defer closeFD(ctx, t, link)
|
||||
|
||||
if linkStat.Ino != fileIno.Ino {
|
||||
|
||||
Reference in New Issue
Block a user