diff options
author | Dean Deng <deandeng@google.com> | 2020-01-16 14:25:56 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-16 15:39:19 -0800 |
commit | 1e7f0c822b3a7c643d532d40a14ab79eb1df85c6 (patch) | |
tree | 2fd1baf1c3dd99af692327ee058d72570bfd4437 /pkg/p9/client_file.go | |
parent | ab48112e41427579ecf585f6280be1e2d58acf06 (diff) |
Bump p9 version, adding corresponding checks to client_file.go.
PiperOrigin-RevId: 290145451
Diffstat (limited to 'pkg/p9/client_file.go')
-rw-r--r-- | pkg/p9/client_file.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/p9/client_file.go b/pkg/p9/client_file.go index 04b584383..0254e4ccc 100644 --- a/pkg/p9/client_file.go +++ b/pkg/p9/client_file.go @@ -170,6 +170,9 @@ func (c *clientFile) GetXattr(name string, size uint64) (string, error) { if atomic.LoadUint32(&c.closed) != 0 { return "", syscall.EBADF } + if !versionSupportsGetSetXattr(c.client.version) { + return "", syscall.EOPNOTSUPP + } rgetxattr := Rgetxattr{} if err := c.client.sendRecv(&Tgetxattr{FID: c.fid, Name: name, Size: size}, &rgetxattr); err != nil { @@ -184,6 +187,9 @@ func (c *clientFile) SetXattr(name, value string, flags uint32) error { if atomic.LoadUint32(&c.closed) != 0 { return syscall.EBADF } + if !versionSupportsGetSetXattr(c.client.version) { + return syscall.EOPNOTSUPP + } return c.client.sendRecv(&Tsetxattr{FID: c.fid, Name: name, Value: value, Flags: flags}, &Rsetxattr{}) } |