mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
locks: break delegations on any attribute modification
NFSv4 uses leases to guarantee that clients can cache metadata as well as data. Cc: Mikulas Patocka <[email protected]> Cc: David Howells <[email protected]> Cc: Tyler Hicks <[email protected]> Cc: Dustin Kirkland <[email protected]> Acked-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
146a8595c6
commit
27ac0ffeac
10 changed files with 69 additions and 17 deletions
|
|
@ -53,6 +53,7 @@ static int utimes_common(struct path *path, struct timespec *times)
|
|||
int error;
|
||||
struct iattr newattrs;
|
||||
struct inode *inode = path->dentry->d_inode;
|
||||
struct inode *delegated_inode = NULL;
|
||||
|
||||
error = mnt_want_write(path->mnt);
|
||||
if (error)
|
||||
|
|
@ -101,9 +102,15 @@ static int utimes_common(struct path *path, struct timespec *times)
|
|||
goto mnt_drop_write_and_out;
|
||||
}
|
||||
}
|
||||
retry_deleg:
|
||||
mutex_lock(&inode->i_mutex);
|
||||
error = notify_change(path->dentry, &newattrs);
|
||||
error = notify_change(path->dentry, &newattrs, &delegated_inode);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
if (delegated_inode) {
|
||||
error = break_deleg_wait(&delegated_inode);
|
||||
if (!error)
|
||||
goto retry_deleg;
|
||||
}
|
||||
|
||||
mnt_drop_write_and_out:
|
||||
mnt_drop_write(path->mnt);
|
||||
|
|
|
|||
Loading…
Reference in a new issue