infra: remove unwanted chmod()

This commit is contained in:
Thomas Schoebel-Theuer 2015-05-26 08:58:55 +02:00
parent f654129e94
commit ac2c901943
2 changed files with 14 additions and 0 deletions

View File

@ -1918,6 +1918,7 @@ int run_bone(struct mars_peerinfo *peer, struct mars_dent *remote_dent)
MARS_IO("timestamps '%s' remote = %ld.%09ld local = %ld.%09ld\n", remote_dent->d_path, remote_dent->new_stat.mtime.tv_sec, remote_dent->new_stat.mtime.tv_nsec, local_stat.mtime.tv_sec, local_stat.mtime.tv_nsec);
#ifdef HAS_MARS_PREPATCH
if ((remote_dent->new_stat.mode & S_IRWXU) !=
(local_stat.mode & S_IRWXU) &&
update_ctime) {
@ -1934,6 +1935,7 @@ int run_bone(struct mars_peerinfo *peer, struct mars_dent *remote_dent)
mars_lchown(remote_dent->d_path, __kuid_val(remote_dent->new_stat.uid));
run_trigger = true;
}
#endif
}
if (S_ISDIR(remote_dent->new_stat.mode)) {
@ -1944,10 +1946,12 @@ int run_bone(struct mars_peerinfo *peer, struct mars_dent *remote_dent)
if (!stat_ok) {
status = mars_mkdir(remote_dent->d_path);
MARS_DBG("create directory '%s' status = %d\n", remote_dent->d_path, status);
#ifdef HAS_MARS_PREPATCH
if (status >= 0) {
mars_chmod(remote_dent->d_path, remote_dent->new_stat.mode);
mars_lchown(remote_dent->d_path, __kuid_val(remote_dent->new_stat.uid));
}
#endif
}
} else if (S_ISLNK(remote_dent->new_stat.mode) && remote_dent->new_link) {
if (!stat_ok || update_mtime) {

View File

@ -314,7 +314,9 @@ int mars_symlink(const char *oldpath, const char *newpath, const struct timespec
status = sys_symlink(oldpath, tmp);
if (status >= 0) {
#ifdef HAS_MARS_PREPATCH
sys_lchown(tmp, uid, 0);
#endif
memcpy(&times[1], &times[0], sizeof(struct timespec));
status = do_utimes(AT_FDCWD, tmp, times, AT_SYMLINK_NOFOLLOW);
}
@ -402,6 +404,7 @@ EXPORT_SYMBOL_GPL(mars_rename);
int mars_chmod(const char *path, mode_t mode)
{
#ifdef HAS_MARS_PREPATCH
mm_segment_t oldfs;
int status;
@ -411,11 +414,15 @@ int mars_chmod(const char *path, mode_t mode)
set_fs(oldfs);
return status;
#else
return -ENOSYS;
#endif
}
EXPORT_SYMBOL_GPL(mars_chmod);
int mars_lchown(const char *path, uid_t uid)
{
#ifdef HAS_MARS_PREPATCH
mm_segment_t oldfs;
int status;
@ -425,6 +432,9 @@ int mars_lchown(const char *path, uid_t uid)
set_fs(oldfs);
return status;
#else
return -ENOSYS;
#endif
}
EXPORT_SYMBOL_GPL(mars_lchown);