summaryrefslogtreecommitdiffstats
path: root/fs/orangefs/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* orangefs: count directory pieces correctlyMartin Brandenburg2017-05-041-2/+5
| | | | | | | | | A large directory full of differently sized file names triggered this. Most directories, even very large directories with shorter names, would be lucky enough to fit in one server response. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: invalidate stored directory on seekMartin Brandenburg2017-05-041-1/+23
| | | | | | | | | If an application seeks to a position before the point which has been read, it must want updates which have been made to the directory. So delete the copy stored in the kernel so it will be fetched again. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: skip forward to the next directory entry if seek is shortMartin Brandenburg2017-05-041-4/+14
| | | | | | | | | | | | | | | | If userspace seeks to a position in the stream which is not correct, it would have returned EIO because the data in the buffer at that offset would be incorrect. This and the userspace daemon returning a corrupt directory are indistinguishable. Now if the data does not look right, skip forward to the next chunk and try again. The motivation is that if the directory changes, an application may seek to a position that was valid and no longer is valid. It is not yet possible for a directory to change. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: remove ORANGEFS_READDIR macrosMartin Brandenburg2017-04-261-4/+4
| | | | | | | | They are clones of the ORANGEFS_ITERATE macros in use elsewhere. Delete ORANGEFS_ITERATE_NEXT which is a hack previously used by readdir. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: support very large directoriesMartin Brandenburg2017-04-261-88/+185
| | | | | | | | | | | | | This works by maintaining a linked list of pages which the directory has been read into rather than one giant fixed-size buffer. This replaces code which limits the total directory size to the total amount that could be returned in one server request. Since filenames are usually considerably shorter than the maximum, the old code could usually handle several server requests before running out of space. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: support llseek on directoriesMartin Brandenburg2017-04-261-14/+36
| | | | | | | This and the previous commit fix xfstests generic/257. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: rewrite readdir to fix several bugsMartin Brandenburg2017-04-261-337/+191
| | | | | | | | | | | | In the past, readdir assumed that the user buffer will be large enough that all entries from the server will fit. If this was not true, entries would be skipped. Since it works now, request 512 entries rather than 96 per server operation. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: use %pd/%pDAl Viro2016-08-071-2/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* orangefs: remove unused variableMartin Brandenburg2016-04-081-3/+1
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: don't put readdir slot twiceMartin Brandenburg2016-03-311-5/+3
| | | | | | | | This was quite an oversight. After a readdir, the module could not be unloaded, the number of slots is wrong, and memory near the slot bitmap is possibly corrupt. Oops. Signed-off-by: Martin Brandenburg <martin@omnibond.com>
* orangefs: saner calling conventions for getting a slotAl Viro2016-03-251-3/+3
| | | | | | | | just have it return the slot number or -E... - the caller checks the sign anyway Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: get rid of readdir_handle_sAl Viro2016-03-251-63/+30
| | | | | | | | no point, really - we couldn't keep those across the calls of getdents(); it would be too easy to DoS, having all slots exhausted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: add a new gossip statementMike Marshall2016-03-091-0/+4
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: free readdir buffer index before the dir_emit loopMartin Brandenburg2016-02-241-25/+9
| | | | | | | | | | | | We only need it while the service operation is actually in progress since it is only used to co-ordinate the client-core's memory use. The kernel allocates its own space. Also clean up some comments which mislead the reader into thinking the readdir buffers are shared memory. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs_readdir_index_put(): get rid of bufmap argumentAl Viro2016-02-191-8/+7
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: add verification to decode_direntsMike Marshall2016-01-151-25/+93
| | | | | | Also add comments to decode_dirents and make it more readable. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: Fix some more global namespace pollution.Martin Brandenburg2016-01-041-9/+14
| | | | | | | This only changes the names of things, so there is no functional change. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: change pvfs2 filenames to orangefsMike Marshall2015-12-041-2/+2
| | | | | | | Also changed references within source files that referred to header files whose names had changed. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* OrangeFS: Change almost all instances of the string PVFS2 to OrangeFS.Yi Liu2015-12-031-43/+43
| | | | | | | | | | | | | | | | | | | | | | OrangeFS was formerly known as PVFS2 and retains the name in many places. I leave the device /dev/pvfs2-req since this affects userspace. I leave the filesystem type pvfs2 since this affects userspace. Further the OrangeFS sysint library reads fstab for an entry of type pvfs2 independently of kernel mounts. I leave extended attribute keys user.pvfs2 and system.pvfs2 as the sysint library understands these. I leave references to userspace binaries still named pvfs2. I leave the filenames. Signed-off-by: Yi Liu <yi9@clemson.edu> [martin@omnibond.com: clairify above constraints and merge] Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: validate the response in decode_dirents()Al Viro2015-11-131-5/+32
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: get rid of dec_string and enc_stringAl Viro2015-11-131-7/+8
| | | | | | | | The latter is never used, the former has one user and would be better off spelled out right there. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: switch decode_dirents() to use of kcalloc()Al Viro2015-11-131-1/+1
| | | | | | | gets rid of multiplication overflow Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: fix some checkpatch.pl complaints that had creeped in.Mike Marshall2015-10-051-1/+1
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: fix dir_emit code in pvfs2_readdir.Mike Marshall2015-10-031-82/+49
| | | | | | | Al Viro glanced at readdir and surmised that getdents would misbehave the way it was written... and sure enough. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: address problems found by static checkerMike Marshall2015-10-031-16/+0
| | | | | | | | | | | | | | Don't check for negative rc from boolean. Don't pointlessly initialize variables, it short-circuits gcc's uninitialized variable warnings. And max_new_nr_segs can never be zero, so don't check for it. Preserve original kstrdup pointer for freeing later. Don't check for negative value in unsigned variable. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: kernel client part 2Mike Marshall2015-10-031-0/+394
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
OpenPOWER on IntegriCloud