mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	vfs: allow utimensat() calls to retry once on an ESTALE error
Clearly, we can't handle the NULL filename case, but we can deal with the case where there's a real pathname. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									96948fc606
								
							
						
					
					
						commit
						a69201d6f0
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -158,13 +158,17 @@ long do_utimes(int dfd, const char __user *filename, struct timespec *times,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!(flags & AT_SYMLINK_NOFOLLOW))
 | 
							if (!(flags & AT_SYMLINK_NOFOLLOW))
 | 
				
			||||||
			lookup_flags |= LOOKUP_FOLLOW;
 | 
								lookup_flags |= LOOKUP_FOLLOW;
 | 
				
			||||||
 | 
					retry:
 | 
				
			||||||
		error = user_path_at(dfd, filename, lookup_flags, &path);
 | 
							error = user_path_at(dfd, filename, lookup_flags, &path);
 | 
				
			||||||
		if (error)
 | 
							if (error)
 | 
				
			||||||
			goto out;
 | 
								goto out;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		error = utimes_common(&path, times);
 | 
							error = utimes_common(&path, times);
 | 
				
			||||||
		path_put(&path);
 | 
							path_put(&path);
 | 
				
			||||||
 | 
							if (retry_estale(error, lookup_flags)) {
 | 
				
			||||||
 | 
								lookup_flags |= LOOKUP_REVAL;
 | 
				
			||||||
 | 
								goto retry;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue