Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c2aad05 authored by Mark Fasheh's avatar Mark Fasheh
Browse files

ocfs2: ignore NULL vfsmnt in ocfs2_should_update_atime()



This can come from NFSD.

Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 564f8a32
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -149,6 +149,17 @@ int ocfs2_should_update_atime(struct inode *inode,
	    ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)))
	    ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)))
		return 0;
		return 0;


	/*
	 * We can be called with no vfsmnt structure - NFSD will
	 * sometimes do this.
	 *
	 * Note that our action here is different than touch_atime() -
	 * if we can't tell whether this is a noatime mount, then we
	 * don't know whether to trust the value of s_atime_quantum.
	 */
	if (vfsmnt == NULL)
		return 0;

	if ((vfsmnt->mnt_flags & MNT_NOATIME) ||
	if ((vfsmnt->mnt_flags & MNT_NOATIME) ||
	    ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)))
	    ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)))
		return 0;
		return 0;