Skip to content

Commit 88025c6

Browse files
Trond MyklebustAnna Schumaker
authored andcommitted
NFS: Adjust delegated timestamps for O_DIRECT reads and writes
Adjust the timestamps if O_DIRECT is being combined with attribute delegations. Fixes: e12912d ("NFSv4: Add support for delegated atime and mtime attributes") Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent fcf857e commit 88025c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/nfs/direct.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include <linux/uaccess.h>
5757
#include <linux/atomic.h>
5858

59+
#include "delegation.h"
5960
#include "internal.h"
6061
#include "iostat.h"
6162
#include "pnfs.h"
@@ -286,6 +287,8 @@ static void nfs_direct_read_completion(struct nfs_pgio_header *hdr)
286287
nfs_direct_count_bytes(dreq, hdr);
287288
spin_unlock(&dreq->lock);
288289

290+
nfs_update_delegated_atime(dreq->inode);
291+
289292
while (!list_empty(&hdr->pages)) {
290293
struct nfs_page *req = nfs_list_entry(hdr->pages.next);
291294
struct page *page = req->wb_page;
@@ -779,6 +782,7 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
779782

780783
spin_lock(&inode->i_lock);
781784
nfs_direct_file_adjust_size_locked(inode, dreq->io_start, dreq->count);
785+
nfs_update_delegated_mtime_locked(dreq->inode);
782786
spin_unlock(&inode->i_lock);
783787

784788
while (!list_empty(&hdr->pages)) {

0 commit comments

Comments
 (0)