Skip to content

Commit 6e19817

Browse files
committed
NFS: Adjust delegated timestamps for O_DIRECT reads and writes
JIRA: https://issues.redhat.com/browse/RHEL-108616 commit 88025c6 Author: Trond Myklebust <[email protected]> Date: Sat Feb 1 14:59:03 2025 -0500 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]> Signed-off-by: Benjamin Coddington <[email protected]>
1 parent e4ac6e5 commit 6e19817

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;
@@ -770,6 +773,7 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
770773

771774
spin_lock(&inode->i_lock);
772775
nfs_direct_file_adjust_size_locked(inode, dreq->io_start, dreq->count);
776+
nfs_update_delegated_mtime_locked(dreq->inode);
773777
spin_unlock(&inode->i_lock);
774778

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

0 commit comments

Comments
 (0)