[Top] [All Lists]

[PATCH] use generic_file_llseek for directories

To: xfs@xxxxxxxxxxx
Subject: [PATCH] use generic_file_llseek for directories
From: Christoph Hellwig <hch@xxxxxx>
Date: Thu, 14 Aug 2008 22:48:17 +0200
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
XFS currently doesn't set up a .llseek for directories and thus defaults
to default_llseek.  default_llseek only takes the BKL which means there
is not exclusion vs xfs_readdir and thus we get a risk of corrupting
the file position.  Additionally default_llseek only allows seeks to
32bit offsets by default.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_file.c      2008-08-12 
18:40:43.000000000 -0300
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c   2008-08-12 18:41:49.000000000 
@@ -546,6 +546,7 @@ const struct file_operations xfs_dir_fil
        .compat_ioctl   = xfs_file_compat_ioctl,
        .fsync          = xfs_file_fsync,
+       .llseek         = generic_file_llseek,
 static struct vm_operations_struct xfs_file_vm_ops = {

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] use generic_file_llseek for directories, Christoph Hellwig <=