Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chdir(2): unspaghettify a bit...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 4e9654c2 f770e4c1

+10 -17
+10 -17
fs/open.c
··· 558 558 struct path path; 559 559 int error; 560 560 unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; 561 - struct filename *name = getname(filename); 561 + CLASS(filename, name)(filename); 562 562 retry: 563 563 error = filename_lookup(AT_FDCWD, name, lookup_flags, &path, NULL); 564 - if (error) 565 - goto out; 566 - 567 - error = path_permission(&path, MAY_EXEC | MAY_CHDIR); 568 - if (error) 569 - goto dput_and_out; 570 - 571 - set_fs_pwd(current->fs, &path); 572 - 573 - dput_and_out: 574 - path_put(&path); 575 - if (retry_estale(error, lookup_flags)) { 576 - lookup_flags |= LOOKUP_REVAL; 577 - goto retry; 564 + if (!error) { 565 + error = path_permission(&path, MAY_EXEC | MAY_CHDIR); 566 + if (!error) 567 + set_fs_pwd(current->fs, &path); 568 + path_put(&path); 569 + if (retry_estale(error, lookup_flags)) { 570 + lookup_flags |= LOOKUP_REVAL; 571 + goto retry; 572 + } 578 573 } 579 - out: 580 - putname(name); 581 574 return error; 582 575 } 583 576