Skip to content

Commit

Permalink
xfs: use file_modified() helper
Browse files Browse the repository at this point in the history
Note that by using the helper, the order of calling file_remove_privs()
after file_update_mtime() in xfs_file_aio_write_checks() has changed.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  • Loading branch information
amir73il authored and djwong committed Jun 9, 2019
1 parent e38f7f5 commit 8c3f406
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions fs/xfs/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,20 +367,7 @@ xfs_file_aio_write_checks(
* lock above. Eventually we should look into a way to avoid
* the pointless lock roundtrip.
*/
if (likely(!(file->f_mode & FMODE_NOCMTIME))) {
error = file_update_time(file);
if (error)
return error;
}

/*
* If we're writing the file then make sure to clear the setuid and
* setgid bits if the process is not being run by root. This keeps
* people from modifying setuid and setgid binaries.
*/
if (!IS_NOSEC(inode))
return file_remove_privs(file);
return 0;
return file_modified(file);
}

static int
Expand Down

0 comments on commit 8c3f406

Please sign in to comment.