X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Focfs2%2Ffile.c;h=f2cd3bf9efb2f6b2dff8b44c44592355e2b44a6e;hb=ef29498655b18d2bfd69048e20835d19333981ab;hp=9fd590b9bde3d69a403902cd60f228e92eea87f6;hpb=cfee47f99bc14a6d7c6b0be2284db2cef310a815;p=linux-2.6 diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 9fd590b9bd..f2cd3bf9ef 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -149,6 +149,17 @@ int ocfs2_should_update_atime(struct inode *inode, ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))) 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) || ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))) return 0; @@ -966,8 +977,6 @@ int ocfs2_permission(struct inode *inode, int mask, struct nameidata *nd) } ret = generic_permission(inode, mask, NULL); - if (ret) - mlog_errno(ret); ocfs2_meta_unlock(inode, 0); out: @@ -1356,13 +1365,13 @@ bail: return ret; } -struct inode_operations ocfs2_file_iops = { +const struct inode_operations ocfs2_file_iops = { .setattr = ocfs2_setattr, .getattr = ocfs2_getattr, .permission = ocfs2_permission, }; -struct inode_operations ocfs2_special_file_iops = { +const struct inode_operations ocfs2_special_file_iops = { .setattr = ocfs2_setattr, .getattr = ocfs2_getattr, .permission = ocfs2_permission,