Commit 5b41bd7b authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

vfs: invalidate stat cache on setxattr and removexattr

Motivation:
as extended attribute cache on the client side bound to regular attribute
cache, changes of extended attributes must invalidate attribute cache to
propagate changes to other clients.

Modification:
invalidate stat cache on setxattr and removexattr

Result:
maintain cache consistency

Acked-by: Paul Millar
Acked-by: Lea Morschel
Target: master
parent eedb5e65
/*
* Copyright (c) 2009 - 2017 Deutsches Elektronen-Synchroton,
* Copyright (c) 2009 - 2019 Deutsches Elektronen-Synchroton,
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
*
* This library is free software; you can redistribute it and/or modify
......@@ -374,4 +374,15 @@ public class VfsCache extends ForwardingFileSystem {
return directoryStream.tail(cookie);
}
@Override
public void removeXattr(Inode inode, String attr) throws IOException {
_inner.removeXattr(inode, attr);
invalidateStatCache(inode);
}
@Override
public void setXattr(Inode inode, String attr, byte[] value, SetXattrMode mode) throws IOException {
_inner.setXattr(inode, attr, value, mode);
invalidateStatCache(inode);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment