Skip to content

Commit 8ea4a5d

Browse files
committed
Merge tag 'for-linus-4.17-ofs' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux
Pull orangefs updates from Mike Marshall: "Fixes and cleanups: - Documentation cleanups - removal of unused code - make some structs static - implement Orangefs vm_operations fault callout - eliminate two single-use functions and put their cleaned up code in line. - replace a vmalloc/memset instance with vzalloc - fix a race condition bug in wait code" * tag 'for-linus-4.17-ofs' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: Orangefs: documentation updates orangefs: document package install and xfstests procedure orangefs: remove unused code orangefs: make several *_operations structs static orangefs: implement vm_ops->fault orangefs: open code short single-use functions orangefs: replace vmalloc and memset with vzalloc orangefs: bug fix for a race condition when getting a slot
2 parents 190f2ac + 8e9ba5c commit 8ea4a5d

File tree

8 files changed

+190
-266
lines changed

8 files changed

+190
-266
lines changed

Documentation/filesystems/orangefs.txt

Lines changed: 112 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ Orangefs features include:
2121
* Stateless
2222

2323

24-
MAILING LIST
25-
============
24+
MAILING LIST ARCHIVES
25+
=====================
2626

27-
http://beowulf-underground.org/mailman/listinfo/pvfs2-users
27+
http://lists.orangefs.org/pipermail/devel_lists.orangefs.org/
28+
29+
30+
MAILING LIST SUBMISSIONS
31+
========================
32+
33+
2834

2935

3036
DOCUMENTATION
@@ -42,48 +48,129 @@ Orangefs versions prior to 2.9.3 would not be compatible with the
4248
upstream version of the kernel client.
4349

4450

45-
BUILDING THE USERSPACE FILESYSTEM ON A SINGLE SERVER
46-
====================================================
51+
RUNNING ORANGEFS ON A SINGLE SERVER
52+
===================================
53+
54+
OrangeFS is usually run in large installations with multiple servers and
55+
clients, but a complete filesystem can be run on a single machine for
56+
development and testing.
57+
58+
On Fedora, install orangefs and orangefs-server.
59+
60+
dnf -y install orangefs orangefs-server
61+
62+
There is an example server configuration file in
63+
/etc/orangefs/orangefs.conf. Change localhost to your hostname if
64+
necessary.
65+
66+
To generate a filesystem to run xfstests against, see below.
67+
68+
There is an example client configuration file in /etc/pvfs2tab. It is a
69+
single line. Uncomment it and change the hostname if necessary. This
70+
controls clients which use libpvfs2. This does not control the
71+
pvfs2-client-core.
72+
73+
Create the filesystem.
74+
75+
pvfs2-server -f /etc/orangefs/orangefs.conf
76+
77+
Start the server.
78+
79+
systemctl start orangefs-server
80+
81+
Test the server.
82+
83+
pvfs2-ping -m /pvfsmnt
84+
85+
Start the client. The module must be compiled in or loaded before this
86+
point.
87+
88+
systemctl start orangefs-client
89+
90+
Mount the filesystem.
91+
92+
mount -t pvfs2 tcp://localhost:3334/orangefs /pvfsmnt
93+
4794

48-
You can omit --prefix if you don't care that things are sprinkled around in
49-
/usr/local. As of version 2.9.6, Orangefs uses Berkeley DB by default, we
50-
will probably be changing the default to lmdb soon.
95+
BUILDING ORANGEFS ON A SINGLE SERVER
96+
====================================
97+
98+
Where OrangeFS cannot be installed from distribution packages, it may be
99+
built from source.
100+
101+
You can omit --prefix if you don't care that things are sprinkled around
102+
in /usr/local. As of version 2.9.6, OrangeFS uses Berkeley DB by
103+
default, we will probably be changing the default to LMDB soon.
51104

52105
./configure --prefix=/opt/ofs --with-db-backend=lmdb
53106

54107
make
55108

56109
make install
57110

58-
Create an orangefs config file:
111+
Create an orangefs config file.
112+
59113
/opt/ofs/bin/pvfs2-genconfig /etc/pvfs2.conf
60114

61-
for "Enter hostnames", use the hostname, don't let it default to
62-
localhost.
115+
Create an /etc/pvfs2tab file.
116+
117+
echo tcp://localhost:3334/orangefs /pvfsmnt pvfs2 defaults,noauto 0 0 > \
118+
/etc/pvfs2tab
119+
120+
Create the mount point you specified in the tab file if needed.
63121

64-
create a pvfs2tab file in /etc:
65-
cat /etc/pvfs2tab
66-
tcp://myhostname:3334/orangefs /mymountpoint pvfs2 defaults,noauto 0 0
122+
mkdir /pvfsmnt
67123

68-
create the mount point you specified in the tab file if needed:
69-
mkdir /mymountpoint
124+
Bootstrap the server.
70125

71-
bootstrap the server:
72-
/opt/ofs/sbin/pvfs2-server /etc/pvfs2.conf -f
126+
/opt/ofs/sbin/pvfs2-server -f /etc/pvfs2.conf
127+
128+
Start the server.
73129

74-
start the server:
75130
/opt/osf/sbin/pvfs2-server /etc/pvfs2.conf
76131

77-
Now the server is running. At this point you might like to
78-
prove things are working with:
132+
Now the server should be running. Pvfs2-ls is a simple
133+
test to verify that the server is running.
134+
135+
/opt/ofs/bin/pvfs2-ls /pvfsmnt
79136

80-
/opt/osf/bin/pvfs2-ls /mymountpoint
137+
If stuff seems to be working, load the kernel module and
138+
turn on the client core.
81139

82-
If stuff seems to be working, turn on the client core:
83-
/opt/osf/sbin/pvfs2-client -p /opt/osf/sbin/pvfs2-client-core
140+
/opt/ofs/sbin/pvfs2-client -p /opt/osf/sbin/pvfs2-client-core
84141

85142
Mount your filesystem.
86-
mount -t pvfs2 tcp://myhostname:3334/orangefs /mymountpoint
143+
144+
mount -t pvfs2 tcp://localhost:3334/orangefs /pvfsmnt
145+
146+
147+
RUNNING XFSTESTS
148+
================
149+
150+
It is useful to use a scratch filesystem with xfstests. This can be
151+
done with only one server.
152+
153+
Make a second copy of the FileSystem section in the server configuration
154+
file, which is /etc/orangefs/orangefs.conf. Change the Name to scratch.
155+
Change the ID to something other than the ID of the first FileSystem
156+
section (2 is usually a good choice).
157+
158+
Then there are two FileSystem sections: orangefs and scratch.
159+
160+
This change should be made before creating the filesystem.
161+
162+
pvfs2-server -f /etc/orangefs/orangefs.conf
163+
164+
To run xfstests, create /etc/xfsqa.config.
165+
166+
TEST_DIR=/orangefs
167+
TEST_DEV=tcp://localhost:3334/orangefs
168+
SCRATCH_MNT=/scratch
169+
SCRATCH_DEV=tcp://localhost:3334/scratch
170+
171+
Then xfstests can be run
172+
173+
./check -pvfs2
87174

88175

89176
OPTIONS

fs/orangefs/devorangefs-req.c

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,10 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
463463
if (op->downcall.type != ORANGEFS_VFS_OP_READDIR)
464464
goto wakeup;
465465

466-
op->downcall.trailer_buf = vmalloc(op->downcall.trailer_size);
466+
op->downcall.trailer_buf = vzalloc(op->downcall.trailer_size);
467467
if (!op->downcall.trailer_buf)
468468
goto Enomem;
469469

470-
memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size);
471470
if (!copy_from_iter_full(op->downcall.trailer_buf,
472471
op->downcall.trailer_size, iter)) {
473472
gossip_err("%s: failed to copy trailer.\n", __func__);
@@ -779,9 +778,35 @@ static long orangefs_devreq_compat_ioctl(struct file *filp, unsigned int cmd,
779778

780779
#endif /* CONFIG_COMPAT is in .config */
781780

781+
static __poll_t orangefs_devreq_poll(struct file *file,
782+
struct poll_table_struct *poll_table)
783+
{
784+
__poll_t poll_revent_mask = 0;
785+
786+
poll_wait(file, &orangefs_request_list_waitq, poll_table);
787+
788+
if (!list_empty(&orangefs_request_list))
789+
poll_revent_mask |= EPOLLIN;
790+
return poll_revent_mask;
791+
}
792+
782793
/* the assigned character device major number */
783794
static int orangefs_dev_major;
784795

796+
static const struct file_operations orangefs_devreq_file_operations = {
797+
.owner = THIS_MODULE,
798+
.read = orangefs_devreq_read,
799+
.write_iter = orangefs_devreq_write_iter,
800+
.open = orangefs_devreq_open,
801+
.release = orangefs_devreq_release,
802+
.unlocked_ioctl = orangefs_devreq_ioctl,
803+
804+
#ifdef CONFIG_COMPAT /* CONFIG_COMPAT is in .config */
805+
.compat_ioctl = orangefs_devreq_compat_ioctl,
806+
#endif
807+
.poll = orangefs_devreq_poll
808+
};
809+
785810
/*
786811
* Initialize orangefs device specific state:
787812
* Must be called at module load time only
@@ -814,29 +839,3 @@ void orangefs_dev_cleanup(void)
814839
"*** /dev/%s character device unregistered ***\n",
815840
ORANGEFS_REQDEVICE_NAME);
816841
}
817-
818-
static __poll_t orangefs_devreq_poll(struct file *file,
819-
struct poll_table_struct *poll_table)
820-
{
821-
__poll_t poll_revent_mask = 0;
822-
823-
poll_wait(file, &orangefs_request_list_waitq, poll_table);
824-
825-
if (!list_empty(&orangefs_request_list))
826-
poll_revent_mask |= EPOLLIN;
827-
return poll_revent_mask;
828-
}
829-
830-
const struct file_operations orangefs_devreq_file_operations = {
831-
.owner = THIS_MODULE,
832-
.read = orangefs_devreq_read,
833-
.write_iter = orangefs_devreq_write_iter,
834-
.open = orangefs_devreq_open,
835-
.release = orangefs_devreq_release,
836-
.unlocked_ioctl = orangefs_devreq_ioctl,
837-
838-
#ifdef CONFIG_COMPAT /* CONFIG_COMPAT is in .config */
839-
.compat_ioctl = orangefs_devreq_compat_ioctl,
840-
#endif
841-
.poll = orangefs_devreq_poll
842-
};

0 commit comments

Comments
 (0)