Commit graph

25 commits

Author SHA1 Message Date
Casey Bodley
18d462a37e pnfs: proper handling of pnfs COMMITs
COMMIT-to-ds: if pnfs_write() finds that its data server requests weren't written stably, it must fail with PNFSERR_IO instead of sending a COMMIT to the mds.  mds COMMITs can only be used for mds WRITEs in this configuration

COMMIT-to-mds: the mds and data servers are required to use a common write/commit verifier, so the mds COMMIT's verifier must be checked against all ds verifiers

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-05-03 11:46:10 -04:00
Casey Bodley
db7caebe28 pnfs: handle partial layout recalls
layout status flags for PNFS_LAYOUT_RECALLED and PNFS_LAYOUT_CHANGED are removed, and replaced by a list of recalled ranges.  recalls during io are added to the list and processed on pnfs_layout_io_finished().  recalls outside of io are processed immediately

new function layout_recall_range() loops through all existing layout segments, and removes ranges that intersect with the range recalled.  deals with 4 cases per segment:
-only the beginning of the segment is recalled
-only the end of the segment is recalled
-the entire segment is recalled
-only a middle part of the segment is recalled

new function pnfs_layout_recall_status() is called before each unit of io, allowing io threads to bail out early if a recall is detected.  takes a layout segment as an argument, and only returns an error if that segment intersects a recalled range

new function pnfs_layout_recall_fenced() is called when map_ds_error() in pnfs_io.c detects fencing.  also takes a layout segment as an argument, and appends a recall matching the range of the segment

pnfs_layout_state_prepare() now checks the given range against the list of recalled ranges

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-05-03 11:46:05 -04:00
Casey Bodley
5cc317e8a5 pnfs: store a list of layout segments
pnfs_layout_state now stores a list instead of a single pnfs_file_layout entry.  when new segments are acquired through LAYOUTGET, they are inserted into the list in order of increasing offset

functions related to pnfs_layout_state_prepare() now operate on the list to find missing layout ranges and segments missing devices

pattern_init() in pnfs_io.c now allocates and initializes io threads for each layout segment in the range

new function pattern_join() will call WaitForMultipleObjects() in a loop, to support io patterns with more than 64 threads.  if pattern_fork() is called with a thread count of 1, the thread function is called directly instead of spawning a new thread

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-05-03 11:45:50 -04:00
Casey Bodley
62ed5248bf cosmetic: moved pnfs io structs to pnfs_io.c
struct pnfs_io_pattern, pnfs_io_thread, and pnfs_io_unit are not referenced outside of pnfs_io.c, so they don't need to be in pnfs.h
also grouped the inline helper functions together at the bottom of pnfs.h

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-05-03 11:45:43 -04:00
Casey Bodley
904cae13f0 pnfs: simplified logic for calculating next stripe unit
added stripe_next_unit() in pnfs_io.c, removed pnfs_file_device_io_unit() from pnfs_device.c

moved get_sparse_fh()/get_dense_fh() to pnfs_io.c, now only called once on pattern_init()

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-05-03 11:45:36 -04:00
Casey Bodley
91609640df pnfs: prepare layout under a single lock
when starting io, both pnfs_read() and pnfs_write() need a guarantee that their range is covered by layout segments.  because we have to drop the lock for LAYOUTGET and GETDEVICEINFO, earlier layout segments may be recalled during this process.  to avoid this, new function pnfs_layout_state_prepare() gets called repeatedly until it can verify under a single lock that 1) the entire desired range is covered with layouts and 2) each of these layouts has an associated device.  whenever pnfs_layout_state_prepare() has to drop its lock for LAYOUTGET or GETDEVICEINFO, it returns PNFS_PENDING

on PNFS_SUCCESS, the caller knows that all segments in the range are valid and can dispatch io to those segments without worrying about recalls, because it still holds the pnfs_layout_state lock

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-05-03 11:45:29 -04:00
Casey Bodley
c59124dd20 superblock: mask getattr requests with supported_attrs
on creation of a new superblock, construct a bitmap for the default attribute mask to be used for GETATTR and READDIR requests on that filesystem.  mask out any unsupported attributes, and store the bitmap in the field nfs41_superblock.default_getattr

replaced function init_getattr_request() with nfs41_superblock_getattr_mask(), which returns a copy of superblock->default_getattr

removed the locking in nfs41_superblock_supported_attrs() and nfs41_superblock_supported_attrs_exclcreat(), as the supported_attrs and suppattr_exclcreat fields are read-only after the superblock is first initialized.  also factored out their common code into a bitmap_intersect() function in util.h

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-02 16:34:02 -04:00
Casey Bodley
bbb1ed696c license changed to LGPL: added COPYING file, changed source file comments
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-19 12:24:43 -04:00
Olga Kornievskaia
aa7a680a40 propagating file change attr on writes 2012-02-08 16:29:25 -05:00
Casey Bodley
ab8a958e35 pnfs: remove code for unused PNFS_THREAD_BY_SERVER
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-12-22 12:36:04 -05:00
Casey Bodley
7efeb31a16 pnfs: send GETATTR after FILE_SYNC ds writes
in the case of ds writes returning FILE_SYNC, we don't need to send a COMMIT or LAYOUTCOMMIT to the mds.  COMMIT and LAYOUTCOMMIT, however, are the places where we do GETATTR(size) to update the attribute cache.  so we must add a separate call to GETATTR to accomplish this after ds writes return FILE_SYNC

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-10-25 11:45:03 -04:00
Casey Bodley
f435606a16 check write verifiers on COMMIT
we were previously only verifying that the server didn't reboot between WRITEs.  COMMIT returns a verifier that needs to be checked as well

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-10-07 14:53:59 -04:00
Casey Bodley
6872152317 pnfs: track last_offset for layoutcommit
iozone tests were failing intermittently against emc-2 due to out-of-order LAYOUTCOMMITs that both specified new_last_offset

nfs41_open_state now maintains a cached value of the last_offset, and avoids sending it with LAYOUTCOMMIT unless the new last_offset is greater than the cached offset.  this cached value is initialized on open/delegation, and updated on setattr for size

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-09-06 17:55:30 -04:00
Casey Bodley
93a907082c pnfs: fix commit-to-ds for dense layouts
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-09-06 17:55:21 -04:00
Casey Bodley
641d9cf14b revert patch: threading by io unit instead of stripe
sorry, earlier Casey, but the patch 'threading by io unit instead of stripe' from 6/20/2010 was nuts!  with PNFS_THREAD_BY_SERVER disabled, we definitely -don't- want to create a separate thread for each io unit (each READ/WRITE request to a ds).  we just want the one per stripe, as the intended alternative to PNFS_THREAD_BY_SERVER

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-09-06 17:55:14 -04:00
Olga Kornievskaia
e7c540464b simplifying argument management in io path 2011-08-25 14:08:45 -04:00
Olga Kornievskaia
04ab888492 [cosmetic] minor license changes
added 2011 year to the copyright line
added authors info to the license
added UofM license to libtirpc files that we modified
(but i probably missed some)
2011-08-12 13:20:12 -04:00
Casey Bodley
c9585d937f pnfs: readwrite uses pnfs_layout_state
nfs41_lock_stateid_arg() is now called only once in handle_read()/handle_write(), and pnfs_read()/pnfs_write() no longer depend on nfs41_open_state

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-03-22 14:49:24 -04:00
Casey Bodley
87f1005ea0 pnfs: avoid LAYOUTCOMMIT for DATA_SYNC or commit to mds
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-03-09 12:53:22 -05:00
Casey Bodley
9cd9744567 pnfs: revoke device info on bulk layout recall
20.3. CB_LAYOUTRECALL
"LAYOUTRECALL4_FSID and LAYOUTRECALL4_ALL specify that all the storage device ID to storage device address mappings in the affected file system(s) are also recalled."

pnfs_file_layout_recall() now takes a nfs41_client instead of just the pnfs_file_layout_list, because both the layout list and device list are accessible from nfs41_client.  for bulk recalls, calls new function pnfs_file_device_list_invalidate().  each device with layout_count=0 is removed and freed, and devices in use are flagged as REVOKED and freed when layout_count->0

layout_recall_return() now takes a pnfs_file_layout instead of pnfs_layout for access to pnfs_file_layout.device.  pnfs_layout_io_start() and pnfs_layout_io_finish() do the same, because pnfs_layout_io_finish() calls layout_recall_return().  layout_recall_return() calls pnfs_file_device_put() to release its reference on the device

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-01-04 14:26:26 -05:00
Casey Bodley
3ecd38e414 recovery: operations take stateid_arg instead of stateid4
operations that require a stateid now take stateid_arg for recovery information.  these operations include close, setattr, lock/unlock, layoutget, and read/write (including pnfs)

nfs41_open_stateid_arg() locks nfs41_open_state and copies its stateid into a stateid_arg
nfs41_lock_stateid_arg() locks nfs41_open_state.last_lock and copies its stateid into a stateid_arg; if there is no lock state, it falls back to nfs41_open_stateid_arg()

pnfs_read/write() now take nfs41_open_state so they can generate stateid_args

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-12-06 14:21:28 -05:00
Olga Kornievskaia
3fe8b2800a fixing pattern_init
shouldn't have been freeing pattern caz it's on the stack.
instead deference the reference we get on the layout.
2010-12-02 14:22:08 -05:00
Casey Bodley
9dcf4021ba pnfs: check status of pnfs_file_device_io_unit()
avoids crashing against misconfigured servers

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 12:11:49 -04:00
Casey Bodley
e4b1bc6ccc pnfs: set stateid.seqid to 0 for data server io
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 12:11:27 -04:00
Casey Bodley
0ad4db4fad fresh git tree for public release
we regretfully had to remove our git history for licensing reasons

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:15:48 -04:00